]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/commit.c
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'
[thirdparty/git.git] / builtin / commit.c
index ae7aaf6dc6835888e4fb55de8a135331ab05316e..294dc574cdda59f85e07a136ef1807f18710da3f 100644 (file)
@@ -510,7 +510,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
        s->nowarn = nowarn;
        s->is_initial = get_oid(s->reference, &oid) ? 1 : 0;
        if (!s->is_initial)
-               hashcpy(s->sha1_commit, oid.hash);
+               oidcpy(&s->oid_commit, &oid);
        s->status_format = status_format;
        s->ignore_submodule_arg = ignore_submodule_arg;
 
@@ -1406,7 +1406,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
 
        s.is_initial = get_oid(s.reference, &oid) ? 1 : 0;
        if (!s.is_initial)
-               hashcpy(s.sha1_commit, oid.hash);
+               oidcpy(&s.oid_commit, &oid);
 
        s.ignore_submodule_arg = ignore_submodule_arg;
        s.status_format = status_format;
@@ -1463,28 +1463,6 @@ static int git_commit_config(const char *k, const char *v, void *cb)
        return git_status_config(k, v, s);
 }
 
-int run_commit_hook(int editor_is_used, const char *index_file, const char *name, ...)
-{
-       struct argv_array hook_env = ARGV_ARRAY_INIT;
-       va_list args;
-       int ret;
-
-       argv_array_pushf(&hook_env, "GIT_INDEX_FILE=%s", index_file);
-
-       /*
-        * Let the hook know that no editor will be launched.
-        */
-       if (!editor_is_used)
-               argv_array_push(&hook_env, "GIT_EDITOR=:");
-
-       va_start(args, name);
-       ret = run_hook_ve(hook_env.argv,name, args);
-       va_end(args);
-       argv_array_clear(&hook_env);
-
-       return ret;
-}
-
 int cmd_commit(int argc, const char **argv, const char *prefix)
 {
        const char *argv_gc_auto[] = {"gc", "--auto", NULL};