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.
This commit is contained in:
Carlos Martín Nieto
2013-09-03 20:26:57 +02:00
parent a400d3ca85
commit 0d24afb089
18 changed files with 58 additions and 138 deletions

View File

@@ -96,7 +96,7 @@ ERL_NIF_TERM
geef_index_add(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{
geef_index *index;
const ERL_NIF_TERM *eentry, *oid;
const ERL_NIF_TERM *eentry;
int arity;
ErlNifBinary path, id;
git_index_entry entry;
@@ -122,11 +122,8 @@ geef_index_add(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
return geef_oom(env);
entry.path = (char *) path.data;
/* Extract the oid from the tuple */
if (!enif_get_tuple(env, eentry[9], &arity, &oid))
return enif_make_badarg(env);
if (!enif_inspect_binary(env, oid[1], &id))
if (!enif_inspect_binary(env, eentry[9], &id))
return enif_make_badarg(env);
git_oid_fromraw(&entry.oid, id.data);

View File

@@ -376,7 +376,7 @@ geef_reference_create(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
geef_repository *repo;
ErlNifBinary name, target;
int error, force;
git_reference *ref;
git_reference *ref = NULL;
const char *pname, *ptarget;
if (!enif_get_resource(env, argv[0], geef_repository_type, (void **) &repo))