From: Junio C Hamano Date: Tue, 17 Dec 2013 22:12:17 +0000 (-0800) Subject: Sync with 1.8.5.2 X-Git-Tag: v1.9-rc0~55 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7794a680e63a2a11b73cb1194653662f2769a792?ds=inline;hp=-c Sync with 1.8.5.2 * maint: Git 1.8.5.2 cmd_repack(): remove redundant local variable "nr_packs" --- 7794a680e63a2a11b73cb1194653662f2769a792 diff --combined builtin/repack.c index 938bc7562e,91e2363c71..ba66c6e377 --- a/builtin/repack.c +++ b/builtin/repack.c @@@ -78,7 -78,7 +78,7 @@@ static void get_non_kept_pack_filenames return; while ((e = readdir(dir)) != NULL) { - if (suffixcmp(e->d_name, ".pack")) + if (!ends_with(e->d_name, ".pack")) continue; len = strlen(e->d_name) - strlen(".pack"); @@@ -123,7 -123,7 +123,7 @@@ int cmd_repack(int argc, const char **a 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 +233,11 @@@ 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 +245,7 @@@ return ret; argv_array_clear(&cmd_args); - if (!nr_packs && !quiet) + if (!names.nr && !quiet) printf("Nothing new to pack.\n"); /*