show_ref(): remove unused "flag" and "cb_data" arguments
The function is not used as a callback, so it doesn't need these arguments. Also change its return type to void. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jan 6, 2012 at 15:12 UTC
bc98201d84eb3eb283aa4ebb9de9f7a3b32b97af
1 file changed
+5
-5
builtin/receive-pack.c
+5
-5
@@ -114,7 +114,7 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
114
return git_default_config(var, value, cb);
115
}
116
117
-static int show_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
117
+static void show_ref(const char *path, const unsigned char *sha1)
118
{
119
if (sent_capabilities)
120
packet_write(1, "%s %s\n", sha1_to_hex(sha1), path);
@@ -124,10 +124,9 @@ static int show_ref(const char *path, const unsigned char *sha1, int flag, void
124
" report-status delete-refs side-band-64k",
125
prefer_ofs_delta ? " ofs-delta" : "");
126
sent_capabilities = 1;
127
- return 0;
127
}
128
130
-static int show_ref_cb(const char *path, const unsigned char *sha1, int flag, void *cb_data)
129
+static int show_ref_cb(const char *path, const unsigned char *sha1, int flag, void *unused)
130
{
131
path = strip_namespace(path);
132
/*
@@ -140,7 +139,8 @@ static int show_ref_cb(const char *path, const unsigned char *sha1, int flag, vo
139
*/
140
if (!path)
141
path = ".have";
143
- return show_ref(path, sha1, flag, cb_data);
142
+ show_ref(path, sha1);
143
+ return 0;
144
}
145
146
static void add_one_alternate_sha1(const unsigned char sha1[20], void *unused)
@@ -162,7 +162,7 @@ static void write_head_info(void)
162
sha1_array_clear(&sa);
163
for_each_ref(show_ref_cb, NULL);
164
if (!sent_capabilities)
165
- show_ref("capabilities^{}", null_sha1, 0, NULL);
165
+ show_ref("capabilities^{}", null_sha1);
166
clear_extra_refs();
167
168
/* EOF */