30 Commits

Author SHA1 Message Date
10301b40c8 Fix compilation warnings and prepare to be a dependency. 2023-04-28 17:49:27 +06:00
mingshun
41b3dabcda Replace the deprecated erlang:now() with os:timestamp() in tests 2015-10-03 20:30:53 +08:00
Carlos Martín Nieto
4b889ed3bb Fix looking up a commit's tree
We were generating the term from the wrong object, meaning the system
was not keeping the object we should be. We were also not setting the
repository or increasing its refcount, meaning bad news when it came
time to GC the object.
2015-04-24 15:38:00 +02:00
Carlos Martín Nieto
ad9acd2356 Allow retrieval of a commit message 2014-12-29 10:11:39 +00:00
Carlos Martín Nieto
98b176c925 Add a minimum of config
This lets us revive the reflog test by letting us set
core.logallrefupdates to true.
2014-05-18 12:03:53 +02:00
Carlos Martín Nieto
688c052f6d Temporarily remove a test
libgit2 recently started caring about the reflog rules and as we use a
bare repo for testing, it does not append.
2014-05-18 11:19:15 +02:00
Carlos Martín Nieto
73af429633 Add geef_reflog:delete() 2014-02-13 18:26:33 +01:00
Carlos Martín Nieto
5520efb72a Correct the signature output from the reflog
The function to convert signatures into erlang terms was returning ok
with the rest of the tuple which geef_sig expects. We do not want the
ok there, so let that function give us the four terms and decide what to
do in each case.

The signature functions still want to return with ok before it, but the
reflog wants them together with the other parameters.
2014-02-13 18:21:45 +01:00
Carlos Martín Nieto
22ab293910 Basic reflog support
For now it simply includes reading in the reflog as a list of
entries. This does mean that the drop/append functions don't need to be
wrapped, as we can use erlang's list handling.

It however also means that we cannot write this back out, as there is
currently no way to create an empty reflog that we can fill with our own
list.
2014-02-13 17:41:11 +01:00
Carlos Martín Nieto
9501ed2377 Add reference has_log() 2014-02-13 14:53:19 +01:00
Carlos Martín Nieto
3110f37ff7 Wrap commit creation 2013-11-24 16:23:01 +01:00
Carlos Martín Nieto
6c272e2c30 index: write out all fields to disc
There is still now way to access what the flags mean, and the times
need to be in pure timestamp form, rather than erlang's.

Non-essential fields are allowed to be 'undefined' and then the
entry's field will remain zeroed.
2013-10-16 15:01:16 +02:00
Carlos Martín Nieto
21464aeece Wrap git_revparse_single 2013-09-05 15:37:01 +02:00
Carlos Martín Nieto
0d24afb089 Get rid of the tagged OID
This means we no longer accept any iolist in some of the functions,
but we might bring it back later.

There is also a new function, geef_ref:create_symbolic() to create
symbolic references, since we can no longer differentiate between a
name and an OID.
2013-09-03 20:37:00 +02:00
Carlos Martín Nieto
15ba2dd65f Add support for index_entry's size field 2013-09-01 19:56:35 +02:00
Carlos Martín Nieto
e39a17fe43 Allow retrieval of index entries
This is still very basic, as we only actually load three fields into
the record.
2013-09-01 15:30:15 +02:00
Carlos Martín Nieto
0bbb69122b Make sure to test geef_ref:resolve() 2013-08-31 17:34:24 +02:00
Carlos Martín Nieto
bb35fce5cc Implement ref iterators 2013-08-09 23:25:55 +02:00
Carlos Martín Nieto
f8f791296a Put the ref tests under the same function 2013-06-09 02:19:53 +02:00
Carlos Martín Nieto
e8684471c0 Add ref shorthand function 2013-06-09 02:14:35 +02:00
Carlos Martín Nieto
042156d843 Bind ref name dwim 2013-06-07 17:55:16 +02:00
Carlos Martín Nieto
ac3d2d03fe Rename the ref record to geef_reference
Remove the access hacks for elixir and make :geef_reference an elixir
macro as well.
2013-06-05 21:22:25 +02:00
Carlos Martín Nieto
4a2f2e8ab2 Namespace the records
This makes it useful for users of the bindings. The naming is the same
as the module to allow elixir to treat the records in much the same
way as its native module/record hybrid.
2013-05-13 11:05:59 +02:00
Carlos Martín Nieto
1077a055dc Remove geef_ref:target/1, use the record 2013-05-11 04:01:55 +02:00
Carlos Martín Nieto
1621871387 Simpify rm_r 2013-05-04 01:05:35 +02:00
Carlos Martín Nieto
3f4d51c0e1 Simple version of index_add 2013-05-03 23:42:49 +02:00
Carlos Martín Nieto
b420b61c19 Clean up after the repo tests 2013-05-02 19:40:01 +02:00
Carlos Martín Nieto
0aa11d8532 Allow creation of refs 2013-05-02 06:24:15 +02:00
Carlos Martín Nieto
353995a2da Properly stop the repo and revwalk servers
Return the 4-tuple when asked to stop instead of the 3-tuple so we do
indicate the stop was normal.
2013-04-10 20:11:07 +02:00
Carlos Martín Nieto
8d7fbb1ec5 Add a couple more tests 2013-03-30 15:11:29 +01:00