repack_without_ref(): remove temporary
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Dec 12, 2011 at 06:38 UTC
fe9c7b78c5487dc4595559fb6e731b46294b6a0d
1 file changed
+2
-5
refs.c
+2
-5
@@ -1278,12 +1278,10 @@ static struct lock_file packlock;
1278
static int repack_without_ref(const char *refname)
1279
{
1280
struct ref_array *packed;
1281
- struct ref_entry *ref;
1281
int fd, i;
1282
1283
packed = get_packed_refs(get_ref_cache(NULL));
1285
- ref = search_ref_array(packed, refname);
1286
- if (ref == NULL)
1284
+ if (search_ref_array(packed, refname) == NULL)
1285
return 0;
1286
fd = hold_lock_file_for_update(&packlock, git_path("packed-refs"), 0);
1287
if (fd < 0) {
@@ -1294,8 +1292,7 @@ static int repack_without_ref(const char *refname)
1292
for (i = 0; i < packed->nr; i++) {
1293
char line[PATH_MAX + 100];
1294
int len;
1297
-
1298
- ref = packed->refs[i];
1295
+ struct ref_entry *ref = packed->refs[i];
1296
1297
if (!strcmp(refname, ref->name))
1298
continue;