summaryrefslogtreecommitdiff
path: root/builtin/repack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-17 22:12:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-17 22:12:17 (GMT)
commit7794a680e63a2a11b73cb1194653662f2769a792 (patch)
tree02af835624487074efb46d224cdc3530d9f83da0 /builtin/repack.c
parentb10cd577d8061912996576a096e2fd5503c770e6 (diff)
parent5512ac5840c8bcaa487806cf402ff960091ab244 (diff)
downloadgit-7794a680e63a2a11b73cb1194653662f2769a792.zip
git-7794a680e63a2a11b73cb1194653662f2769a792.tar.gz
git-7794a680e63a2a11b73cb1194653662f2769a792.tar.bz2
Sync with 1.8.5.2
* maint: Git 1.8.5.2 cmd_repack(): remove redundant local variable "nr_packs"
Diffstat (limited to 'builtin/repack.c')
-rw-r--r--builtin/repack.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index 938bc75..ba66c6e 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -123,7 +123,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
struct string_list rollback = STRING_LIST_INIT_NODUP;
struct string_list existing_packs = STRING_LIST_INIT_DUP;
struct strbuf line = STRBUF_INIT;
- int nr_packs, ext, ret, failed;
+ int ext, ret, failed;
FILE *out;
/* variables to be filled by option parsing */
@@ -233,13 +233,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (ret)
return ret;
- nr_packs = 0;
out = xfdopen(cmd.out, "r");
while (strbuf_getline(&line, out, '\n') != EOF) {
if (line.len != 40)
die("repack: Expecting 40 character sha1 lines only from pack-objects.");
string_list_append(&names, line.buf);
- nr_packs++;
}
fclose(out);
ret = finish_command(&cmd);
@@ -247,7 +245,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
return ret;
argv_array_clear(&cmd_args);
- if (!nr_packs && !quiet)
+ if (!names.nr && !quiet)
printf("Nothing new to pack.\n");
/*