Add geef_odb:write

This commit is contained in:
Carlos Martín Nieto
2013-03-30 14:19:05 +01:00
parent 5ee6b055e9
commit 125e132af9
7 changed files with 58 additions and 2 deletions

View File

@@ -28,6 +28,20 @@ ERL_NIF_TERM geef_object_type2atom(const git_otype type)
}
}
git_otype geef_object_atom2type(ERL_NIF_TERM term)
{
if (!enif_compare(term, atoms.commit))
return GIT_OBJ_COMMIT;
else if (!enif_compare(term, atoms.tree))
return GIT_OBJ_TREE;
else if (!enif_compare(term, atoms.blob))
return GIT_OBJ_BLOB;
else if (!enif_compare(term, atoms.tag))
return GIT_OBJ_TAG;
return GIT_OBJ_BAD;
}
ERL_NIF_TERM
geef_object_lookup(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{