diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2019-02-19 01:05:20 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-01 04:57:39 +0200 |
commit | bbf05cf70e5d0ba113ea4ed4c7c77cb890707911 (patch) | |
tree | 385cde5377863205a589bf0bbf71cd06727a826b /archive.c | |
parent | builtin/get-tar-commit-id: make hash size independent (diff) | |
download | git-bbf05cf70e5d0ba113ea4ed4c7c77cb890707911.tar.xz git-bbf05cf70e5d0ba113ea4ed4c7c77cb890707911.zip |
archive: convert struct archiver_args to object_id
Change the commit_sha1 member to be called "commit_oid" and change it to
be a pointer to struct object_id. Additionally, update some uses of
GIT_SHA1_HEXSZ and hard-coded values to use the_hash_algo instead.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive.c')
-rw-r--r-- | archive.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -380,7 +380,7 @@ static void parse_treeish_arg(const char **argv, int remote) { const char *name = argv[0]; - const unsigned char *commit_sha1; + const struct object_id *commit_oid; time_t archive_time; struct tree *tree; const struct commit *commit; @@ -402,10 +402,10 @@ static void parse_treeish_arg(const char **argv, commit = lookup_commit_reference_gently(ar_args->repo, &oid, 1); if (commit) { - commit_sha1 = commit->object.oid.hash; + commit_oid = &commit->object.oid; archive_time = commit->date; } else { - commit_sha1 = NULL; + commit_oid = NULL; archive_time = time(NULL); } @@ -426,7 +426,7 @@ static void parse_treeish_arg(const char **argv, tree = parse_tree_indirect(&tree_oid); } ar_args->tree = tree; - ar_args->commit_sha1 = commit_sha1; + ar_args->commit_oid = commit_oid; ar_args->commit = commit; ar_args->time = archive_time; } |