Merge branch 'dk/gc-idx-wo-pack' into maint

Having a leftover .idx file without corresponding .pack file in
the repository hurts performance; "git gc" learned to prune them.

We may want to do the same for .bitmap (and notice but not prune
.keep) without corresponding .pack, but that can be a separate
topic.

* dk/gc-idx-wo-pack:
  gc: remove garbage .idx files from pack dir
  t5304: test cleaning pack garbage
  prepare_packed_git(): refactor garbage reporting in pack directory
This commit is contained in:
Junio C Hamano
2015-12-04 11:33:07 -08:00
6 changed files with 78 additions and 22 deletions

2
path.c
View File

@ -147,7 +147,7 @@ void report_linked_checkout_garbage(void)
strbuf_setlen(&sb, len);
strbuf_addstr(&sb, path);
if (file_exists(sb.buf))
report_garbage("unused in linked checkout", sb.buf);
report_garbage(PACKDIR_FILE_GARBAGE, sb.buf);
}
strbuf_release(&sb);
}