diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-05 19:17:37 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-05 19:17:37 (GMT) |
commit | 5455ee0573a22bb793a7083d593ae1ace909cd4c (patch) | |
tree | 3811517867826edb4bfa8ff2737b76af5c50784c /transport.c | |
parent | c4a8354bc14e20d5ca6dc353e17e5b27fefefdab (diff) | |
parent | 5cb901a4b0e19c87a1415f0f74995e54690598af (diff) | |
download | git-5455ee0573a22bb793a7083d593ae1ace909cd4c.zip git-5455ee0573a22bb793a7083d593ae1ace909cd4c.tar.gz git-5455ee0573a22bb793a7083d593ae1ace909cd4c.tar.bz2 |
Merge branch 'bc/object-id'
for_each_ref() callback functions were taught to name the objects
not with "unsigned char sha1[20]" but with "struct object_id".
* bc/object-id: (56 commits)
struct ref_lock: convert old_sha1 member to object_id
warn_if_dangling_symref(): convert local variable "junk" to object_id
each_ref_fn_adapter(): remove adapter
rev_list_insert_ref(): remove unneeded arguments
rev_list_insert_ref_oid(): new function, taking an object_oid
mark_complete(): remove unneeded arguments
mark_complete_oid(): new function, taking an object_oid
clear_marks(): rewrite to take an object_id argument
mark_complete(): rewrite to take an object_id argument
send_ref(): convert local variable "peeled" to object_id
upload-pack: rewrite functions to take object_id arguments
find_symref(): convert local variable "unused" to object_id
find_symref(): rewrite to take an object_id argument
write_one_ref(): rewrite to take an object_id argument
write_refs_to_temp_dir(): convert local variable sha1 to object_id
submodule: rewrite to take an object_id argument
shallow: rewrite functions to take object_id arguments
handle_one_ref(): rewrite to take an object_id argument
add_info_ref(): rewrite to take an object_id argument
handle_one_reflog(): rewrite to take an object_id argument
...
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/transport.c b/transport.c index f080e93..40692f8 100644 --- a/transport.c +++ b/transport.c @@ -278,8 +278,8 @@ static int fetch_objs_via_rsync(struct transport *transport, return run_command(&rsync); } -static int write_one_ref(const char *name, const unsigned char *sha1, - int flags, void *data) +static int write_one_ref(const char *name, const struct object_id *oid, + int flags, void *data) { struct strbuf *buf = data; int len = buf->len; @@ -291,7 +291,7 @@ static int write_one_ref(const char *name, const unsigned char *sha1, strbuf_addstr(buf, name); if (safe_create_leading_directories(buf->buf) || - write_file(buf->buf, 0, "%s\n", sha1_to_hex(sha1))) + write_file(buf->buf, 0, "%s\n", oid_to_hex(oid))) return error("problems writing temporary file %s: %s", buf->buf, strerror(errno)); strbuf_setlen(buf, len); @@ -299,18 +299,18 @@ static int write_one_ref(const char *name, const unsigned char *sha1, } static int write_refs_to_temp_dir(struct strbuf *temp_dir, - int refspec_nr, const char **refspec) + int refspec_nr, const char **refspec) { int i; for (i = 0; i < refspec_nr; i++) { - unsigned char sha1[20]; + struct object_id oid; char *ref; - if (dwim_ref(refspec[i], strlen(refspec[i]), sha1, &ref) != 1) + if (dwim_ref(refspec[i], strlen(refspec[i]), oid.hash, &ref) != 1) return error("Could not get ref %s", refspec[i]); - if (write_one_ref(ref, sha1, 0, temp_dir)) { + if (write_one_ref(ref, &oid, 0, temp_dir)) { free(ref); return -1; } |