summaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-03-03 18:52:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-03 19:06:01 (GMT)
commit0e94242df1ba11830c5443a55decaa041fa97710 (patch)
tree4f6aee39f425bff7d1bd0c634c972a753fb37c28 /builtin/index-pack.c
parent592ce20820ac36dd868dfd1e61b1aeb3cd3f902a (diff)
downloadgit-0e94242df1ba11830c5443a55decaa041fa97710.zip
git-0e94242df1ba11830c5443a55decaa041fa97710.tar.gz
git-0e94242df1ba11830c5443a55decaa041fa97710.tar.bz2
index-pack: correct --keep[=<msg>]
When 592ce208 (index-pack: use strip_suffix to avoid magic numbers, 2014-06-30) refactored the code to derive names of .idx and .keep files from the name of .pack file, a copy-and-paste typo crept in, mistakingly attempting to create and store the keep message file in the .idx file we just created, instead of .keep file. As we create the .keep file with O_CREAT|O_EXCL, and we do so after we write the .idx file, we luckily do not clobber the .idx file, but because we deliberately ignored EEXIST when creating .keep file (which is justifiable because only the existence of .keep file matters), nobody noticed this mistake so far. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index d4b77fd..3814731 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1617,7 +1617,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
die(_("packfile name '%s' does not end with '.pack'"),
pack_name);
strbuf_add(&keep_name_buf, pack_name, len);
- strbuf_addstr(&keep_name_buf, ".idx");
+ strbuf_addstr(&keep_name_buf, ".keep");
keep_name = keep_name_buf.buf;
}
if (verify) {