bug fix to commit create (when parents are given)
This commit is contained in:
committed by
Carlos Martín Nieto
parent
6c73d9e29e
commit
f943274ad8
@@ -117,7 +117,7 @@ geef_commit_create(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
|
|||||||
return geef_oom(env);
|
return geef_oom(env);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
tail = argv[8];
|
tail = argv[7];
|
||||||
while (enif_get_list_cell(env, tail, &head, &tail)) {
|
while (enif_get_list_cell(env, tail, &head, &tail)) {
|
||||||
if (!enif_inspect_binary(env, head, &bin))
|
if (!enif_inspect_binary(env, head, &bin))
|
||||||
return enif_make_badarg(env);
|
return enif_make_badarg(env);
|
||||||
@@ -145,14 +145,12 @@ ERL_NIF_TERM
|
|||||||
geef_commit_message(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
|
geef_commit_message(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
|
||||||
{
|
{
|
||||||
ErlNifBinary bin;
|
ErlNifBinary bin;
|
||||||
geef_object *obj, *tree;
|
geef_object *obj;
|
||||||
const char *msg;
|
const char *msg;
|
||||||
|
|
||||||
if (!enif_get_resource(env, argv[0], geef_object_type, (void **) &obj))
|
if (!enif_get_resource(env, argv[0], geef_object_type, (void **) &obj))
|
||||||
return enif_make_badarg(env);
|
return enif_make_badarg(env);
|
||||||
|
|
||||||
tree = enif_alloc_resource(geef_object_type, sizeof(geef_object));
|
|
||||||
|
|
||||||
msg = git_commit_message((git_commit *) obj->obj);
|
msg = git_commit_message((git_commit *) obj->obj);
|
||||||
if (geef_string_to_bin(&bin, msg) < 0)
|
if (geef_string_to_bin(&bin, msg) < 0)
|
||||||
return geef_error(env);
|
return geef_error(env);
|
||||||
|
|||||||
Reference in New Issue
Block a user