summaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2014-02-02 15:09:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-02-05 19:58:49 (GMT)
commit9d7fbfd20422cd23fdb346ac8d609b45b4d37001 (patch)
tree8d8cd247a12e716965105b04949d9653dbb95e08 /editor.c
parentb861e235bc68e1c085e48d029579afbeeeec995c (diff)
downloadgit-9d7fbfd20422cd23fdb346ac8d609b45b4d37001.zip
git-9d7fbfd20422cd23fdb346ac8d609b45b4d37001.tar.gz
git-9d7fbfd20422cd23fdb346ac8d609b45b4d37001.tar.bz2
repack.c: rename and unlink pack file if it exists
When a repo was fully repacked, and is repacked again, we may run into the situation that "new" packfiles have the same name as already existing ones (traditionally packfiles have been named after the list of names of objects in them, so repacking all the objects in a single pack would have produced a packfile with the same name). The logic is to rename the existing ones into filename like "old-XXX", create the new ones and then remove the "old-" ones. When something went wrong in the middle, this sequence is rolled back by renaming the "old-" files back. The renaming into "old-" did not work as intended, because file_exists() was done on "XXX", not "pack-XXX". Also when rolling back the change, the code tried to rename "old-pack-XXX" but the saved ones are named "old-XXX", so this couldn't have worked. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'editor.c')
0 files changed, 0 insertions, 0 deletions