builtin/clone: convert to struct object_id

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Feb 21, 2017 at 23:47 UTC ddc2cc64e19e2aee35bdb60d960684356555fad6
1 file changed +5 -5
builtin/clone.c
+5 -5
@@ -681,7 +681,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
681
682 static int checkout(int submodule_progress)
683 {
684 - unsigned char sha1[20];
684 + struct object_id oid;
685 char *head;
686 struct lock_file *lock_file;
687 struct unpack_trees_options opts;
@@ -692,7 +692,7 @@ static int checkout(int submodule_progress)
692 if (option_no_checkout)
693 return 0;
694
695 - head = resolve_refdup("HEAD", RESOLVE_REF_READING, sha1, NULL);
695 + head = resolve_refdup("HEAD", RESOLVE_REF_READING, oid.hash, NULL);
696 if (!head) {
697 warning(_("remote HEAD refers to nonexistent ref, "
698 "unable to checkout.\n"));
@@ -700,7 +700,7 @@ static int checkout(int submodule_progress)
700 }
701 if (!strcmp(head, "HEAD")) {
702 if (advice_detached_head)
703 - detach_advice(sha1_to_hex(sha1));
703 + detach_advice(oid_to_hex(&oid));
704 } else {
705 if (!starts_with(head, "refs/heads/"))
706 die(_("HEAD not found below refs/heads!"));
@@ -721,7 +721,7 @@ static int checkout(int submodule_progress)
721 opts.src_index = &the_index;
722 opts.dst_index = &the_index;
723
724 - tree = parse_tree_indirect(sha1);
724 + tree = parse_tree_indirect(oid.hash);
725 parse_tree(tree);
726 init_tree_desc(&t, tree->buffer, tree->size);
727 if (unpack_trees(1, &t, &opts) < 0)
@@ -731,7 +731,7 @@ static int checkout(int submodule_progress)
731 die(_("unable to write new index file"));
732
733 err |= run_hook_le(NULL, "post-checkout", sha1_to_hex(null_sha1),
734 - sha1_to_hex(sha1), "1", NULL);
734 + oid_to_hex(&oid), "1", NULL);
735
736 if (!err && option_recursive) {
737 struct argv_array args = ARGV_ARRAY_INIT;