Merge branch 'kw/commit-keep-index-when-pre-commit-is-not-run' into next
[gitweb.git] / archive.c
index 60b889198656f42a1d073503c4da5886bf0a0526..557dd2db85ff261ee00ec50ea0bfe286bff7bda3 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 #include "refs.h"
 #include "commit.h"
 #include "tree-walk.h"
@@ -357,10 +358,10 @@ static void parse_treeish_arg(const char **argv,
                free(ref);
        }
 
-       if (get_sha1(name, oid.hash))
+       if (get_oid(name, &oid))
                die("Not a valid object name");
 
-       commit = lookup_commit_reference_gently(oid.hash, 1);
+       commit = lookup_commit_reference_gently(&oid, 1);
        if (commit) {
                commit_sha1 = commit->object.oid.hash;
                archive_time = commit->date;
@@ -369,7 +370,7 @@ static void parse_treeish_arg(const char **argv,
                archive_time = time(NULL);
        }
 
-       tree = parse_tree_indirect(oid.hash);
+       tree = parse_tree_indirect(&oid);
        if (tree == NULL)
                die("not a tree object");
 
@@ -383,7 +384,7 @@ static void parse_treeish_arg(const char **argv,
                if (err || !S_ISDIR(mode))
                        die("current working directory is untracked");
 
-               tree = parse_tree_indirect(tree_oid.hash);
+               tree = parse_tree_indirect(&tree_oid);
        }
        ar_args->tree = tree;
        ar_args->commit_sha1 = commit_sha1;