summaryrefslogtreecommitdiff
path: root/builtin/remote.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-05-25 18:38:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-25 19:19:30 (GMT)
commit45690a57a3aaba862a66096f3ebdf9a412643cf1 (patch)
treee36f00b7b452492beb5968ee1363c16406d85df4 /builtin/remote.c
parent5bcad1bce2a2ce20a7d1a24842a2f66be4507b6b (diff)
downloadgit-45690a57a3aaba862a66096f3ebdf9a412643cf1.zip
git-45690a57a3aaba862a66096f3ebdf9a412643cf1.tar.gz
git-45690a57a3aaba862a66096f3ebdf9a412643cf1.tar.bz2
add_branch_for_removal(): rewrite to take an object_id argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/remote.c')
-rw-r--r--builtin/remote.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 27a611b..1986e98 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -509,7 +509,7 @@ struct branches_for_remote {
};
static int add_branch_for_removal(const char *refname,
- const unsigned char *sha1, int flags, void *cb_data)
+ const struct object_id *oid, int flags, void *cb_data)
{
struct branches_for_remote *branches = cb_data;
struct refspec refspec;
@@ -545,7 +545,7 @@ static int add_branch_for_removal(const char *refname,
item = string_list_append(branches->branches, refname);
item->util = xmalloc(20);
- hashcpy(item->util, sha1);
+ hashcpy(item->util, oid->hash);
return 0;
}
@@ -783,8 +783,6 @@ static int rm(int argc, const char **argv)
struct string_list skipped = STRING_LIST_INIT_DUP;
struct branches_for_remote cb_data;
int i, result;
- struct each_ref_fn_sha1_adapter wrapped_add_branch_for_removal =
- {add_branch_for_removal, &cb_data};
memset(&cb_data, 0, sizeof(cb_data));
cb_data.branches = &branches;
@@ -825,7 +823,7 @@ static int rm(int argc, const char **argv)
* refs, which are invalidated when deleting a branch.
*/
cb_data.remote = remote;
- result = for_each_ref(each_ref_fn_adapter, &wrapped_add_branch_for_removal);
+ result = for_each_ref(add_branch_for_removal, &cb_data);
strbuf_release(&buf);
if (!result)