summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-17 20:50:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-17 20:50:25 (GMT)
commite1fae930193b3e8ff02cee936605625f63e1d1e4 (patch)
tree90ad9f3e50d1f1d6acd174ecb4dc0a8bbc28df27 /builtin/clone.c
parent0a4ae91d1cf72b1185a46e5f072ac6b25b92350b (diff)
parente86ab2c1cd60ec4b9214e5cd8450a474fa175f5c (diff)
downloadgit-e1fae930193b3e8ff02cee936605625f63e1d1e4.zip
git-e1fae930193b3e8ff02cee936605625f63e1d1e4.tar.gz
git-e1fae930193b3e8ff02cee936605625f63e1d1e4.tar.bz2
Merge branch 'bc/object-id'
"uchar [40]" to "struct object_id" conversion continues. * bc/object-id: wt-status: convert to struct object_id builtin/merge-base: convert to struct object_id Convert object iteration callbacks to struct object_id sha1_file: introduce an nth_packed_object_oid function refs: simplify parsing of reflog entries refs: convert each_reflog_ent_fn to struct object_id reflog-walk: convert struct reflog_info to struct object_id builtin/replace: convert to struct object_id Convert remaining callers of resolve_refdup to object_id builtin/merge: convert to struct object_id builtin/clone: convert to struct object_id builtin/branch: convert to struct object_id builtin/grep: convert to struct object_id builtin/fmt-merge-message: convert to struct object_id builtin/fast-export: convert to struct object_id builtin/describe: convert to struct object_id builtin/diff-tree: convert to struct object_id builtin/commit: convert to struct object_id hex: introduce parse_oid_hex
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 3f63edb..b4c929b 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -681,7 +681,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
static int checkout(int submodule_progress)
{
- unsigned char sha1[20];
+ struct object_id oid;
char *head;
struct lock_file *lock_file;
struct unpack_trees_options opts;
@@ -692,7 +692,7 @@ static int checkout(int submodule_progress)
if (option_no_checkout)
return 0;
- head = resolve_refdup("HEAD", RESOLVE_REF_READING, sha1, NULL);
+ head = resolve_refdup("HEAD", RESOLVE_REF_READING, oid.hash, NULL);
if (!head) {
warning(_("remote HEAD refers to nonexistent ref, "
"unable to checkout.\n"));
@@ -700,7 +700,7 @@ static int checkout(int submodule_progress)
}
if (!strcmp(head, "HEAD")) {
if (advice_detached_head)
- detach_advice(sha1_to_hex(sha1));
+ detach_advice(oid_to_hex(&oid));
} else {
if (!starts_with(head, "refs/heads/"))
die(_("HEAD not found below refs/heads!"));
@@ -721,7 +721,7 @@ static int checkout(int submodule_progress)
opts.src_index = &the_index;
opts.dst_index = &the_index;
- tree = parse_tree_indirect(sha1);
+ tree = parse_tree_indirect(oid.hash);
parse_tree(tree);
init_tree_desc(&t, tree->buffer, tree->size);
if (unpack_trees(1, &t, &opts) < 0)
@@ -731,7 +731,7 @@ static int checkout(int submodule_progress)
die(_("unable to write new index file"));
err |= run_hook_le(NULL, "post-checkout", sha1_to_hex(null_sha1),
- sha1_to_hex(sha1), "1", NULL);
+ oid_to_hex(&oid), "1", NULL);
if (!err && option_recursive) {
struct argv_array args = ARGV_ARRAY_INIT;