Skip to content

Commit

Permalink
Merge branch 'jc/maint-index-pack-keep'
Browse files Browse the repository at this point in the history
"git index-pack --keep[=<msg>] pack-$name.pack" simply did not work.

* jc/maint-index-pack-keep:
  index-pack: correct --keep[=<msg>]
  • Loading branch information
Junio C Hamano committed Apr 3, 2016
2 parents 3b8c4b7 + 0e94242 commit d4a2230
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,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) {
Expand Down
6 changes: 6 additions & 0 deletions t/t5300-pack-object.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' '
Expand Down

0 comments on commit d4a2230

Please sign in to comment.