Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/clone: convert to struct object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Tue, 21 Feb 2017 23:47:27 +0000
(23:47 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 22 Feb 2017 18:12:15 +0000
(10:12 -0800)
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0c77cd2
)
diff --git
a/builtin/clone.c
b/builtin/clone.c
index 3f63edbbf94fdf83307621ed822722e5c9f89321..b4c929bb8afbf94967949279a1cc3b9b21dae100 100644
(file)
--- 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)
{
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;
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;
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"));
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)
}
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!"));
} 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;
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)
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),
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;
if (!err && option_recursive) {
struct argv_array args = ARGV_ARRAY_INIT;