From: Junio C Hamano Date: Tue, 25 Mar 2014 18:08:19 +0000 (-0700) Subject: Merge branch 'nd/index-pack-error-message' X-Git-Tag: v2.0.0-rc0~64 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0e8c09263e87c548de006cdb6af035d42f845087?hp=-c Merge branch 'nd/index-pack-error-message' * nd/index-pack-error-message: index-pack: report error using the correct variable --- 0e8c09263e87c548de006cdb6af035d42f845087 diff --combined builtin/index-pack.c index a6b1c17996,80c9374135..b9f6e12c0e --- 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"; } } @@@ -1502,7 -1502,7 +1502,7 @@@ int cmd_index_pack(int argc, const cha if (argc == 2 && !strcmp(argv[1], "-h")) usage(index_pack_usage); - read_replace_refs = 0; + check_replace_refs = 0; reset_pack_idx_option(&opts); git_config(git_index_pack_config, &opts); @@@ -1534,9 -1534,9 +1534,9 @@@ 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)