diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-03-03 10:52:53 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-03-03 11:06:01 -0800 |
commit | 0e94242df1ba11830c5443a55decaa041fa97710 (patch) | |
tree | 4f6aee39f425bff7d1bd0c634c972a753fb37c28 /t/t5300-pack-object.sh | |
parent | 592ce20820ac36dd868dfd1e61b1aeb3cd3f902a (diff) | |
download | git-0e94242df1ba11830c5443a55decaa041fa97710.tar.gz |
index-pack: correct --keep[=<msg>]jc/maint-index-pack-keep
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 't/t5300-pack-object.sh')
-rwxr-xr-x | t/t5300-pack-object.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 20c1961515..0e3cadfd57 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -284,6 +284,12 @@ test_expect_success \ git index-pack test-3.pack && cmp test-3.idx test-3-${packname_3}.idx && + cat test-1-${packname_1}.pack >test-4.pack && + rm -f test-4.keep && + git index-pack --keep=why test-4.pack && + cmp test-1-${packname_1}.idx test-4.idx && + test -f test-4.keep && + :' test_expect_success 'unpacking with --strict' ' |