write_refs_to_temp_dir(): convert local variable sha1 to object_id

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>

Michael Haggerty committed May 25, 2015 at 18:39 UTC f31ba7e11611d17a460ed203ed3aa8142d662ff9
1 file changed +4 -4
transport.c
+4 -4
@@ -299,18 +299,18 @@ static int write_one_ref(const char *name, const unsigned char *sha1,
299 }
300
301 static int write_refs_to_temp_dir(struct strbuf *temp_dir,
302 - int refspec_nr, const char **refspec)
302 + int refspec_nr, const char **refspec)
303 {
304 int i;
305
306 for (i = 0; i < refspec_nr; i++) {
307 - unsigned char sha1[20];
307 + struct object_id oid;
308 char *ref;
309
310 - if (dwim_ref(refspec[i], strlen(refspec[i]), sha1, &ref) != 1)
310 + if (dwim_ref(refspec[i], strlen(refspec[i]), oid.hash, &ref) != 1)
311 return error("Could not get ref %s", refspec[i]);
312
313 - if (write_one_ref(ref, sha1, 0, temp_dir)) {
313 + if (write_one_ref(ref, oid.hash, 0, temp_dir)) {
314 free(ref);
315 return -1;
316 }