From: Junio C Hamano Date: Thu, 3 Apr 2014 20:39:04 +0000 (-0700) Subject: Merge branch 'nd/index-pack-error-message' into maint X-Git-Tag: v1.9.2~14 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3dd108348f53d26acad91ce6059c94ec5a9390d2?ds=inline;hp=-c Merge branch 'nd/index-pack-error-message' into maint * nd/index-pack-error-message: index-pack: report error using the correct variable --- 3dd108348f53d26acad91ce6059c94ec5a9390d2 diff --combined builtin/index-pack.c index 2f37a38fbc,80c9374135..fa74972886 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@@ -1291,7 -1291,7 +1291,7 @@@ static void final(const char *final_pac if (keep_fd < 0) { if (errno != EEXIST) die_errno(_("cannot write keep file '%s'"), - keep_name); + keep_name ? keep_name : name); } else { if (keep_msg_len > 0) { write_or_die(keep_fd, keep_msg, keep_msg_len); @@@ -1299,7 -1299,7 +1299,7 @@@ } if (close(keep_fd) != 0) die_errno(_("cannot close written keep file '%s'"), - keep_name); + keep_name ? keep_name : name); report = "keep"; } } @@@ -1534,9 -1534,9 +1534,9 @@@ int cmd_index_pack(int argc, const cha stat_only = 1; } else if (!strcmp(arg, "--keep")) { keep_msg = ""; - } else if (!prefixcmp(arg, "--keep=")) { + } else if (starts_with(arg, "--keep=")) { keep_msg = arg + 7; - } else if (!prefixcmp(arg, "--threads=")) { + } else if (starts_with(arg, "--threads=")) { char *end; nr_threads = strtoul(arg+10, &end, 0); if (!arg[10] || *end || nr_threads < 0) @@@ -1547,7 -1547,7 +1547,7 @@@ "ignoring %s"), arg); nr_threads = 1; #endif - } else if (!prefixcmp(arg, "--pack_header=")) { + } else if (starts_with(arg, "--pack_header=")) { struct pack_header *hdr; char *c; @@@ -1566,7 -1566,7 +1566,7 @@@ if (index_name || (i+1) >= argc) usage(index_pack_usage); index_name = argv[++i]; - } else if (!prefixcmp(arg, "--index-version=")) { + } else if (starts_with(arg, "--index-version=")) { char *c; opts.version = strtoul(arg + 16, &c, 10); if (opts.version > 2)