{"thread":{"id":"8307","subject":"[PATCH] Ensure git-repack -a -d --max-pack-size=N deletes correct packs","startedAt":"2007-05-25T02:06:42Z","lastAt":"2007-05-25T02:06:42Z","messageCount":1,"participants":["Dana How"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"43205","messageId":"465644B2.5040203@gmail.com","threadId":"8307","inReplyTo":null,"subject":"[PATCH] Ensure git-repack -a -d --max-pack-size=N deletes correct packs","fromName":"Dana How","fromEmail":"danahow@gmail.com","sentAt":"2007-05-25T02:06:42Z","receivedAt":"2007-05-25T02:06:42Z","isPatch":true,"sender":{"key":"danahow@gmail.com","avatar":null},"body":"\nThe packfile portion of the \"remove redundant\" code\nnear the bottom of git-repack.sh is broken when\npack splitting occurs.  Particularly since this is\nthe only place where we automatically delete packfiles,\nmake sure it works properly for all cases,  old or new.\n\nThis is based on \"next\".\n\nSigned-off-by: Dana L. How <danahow@gmail.com>\n---\n git-repack.sh |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/git-repack.sh b/git-repack.sh\nindex 4ea6e5b..0591bd7 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -69,6 +69,7 @@ if [ -z \"$names\" ]; then\n \techo Nothing new to pack.\n fi\n for name in $names ; do\n+\tfullbases=\"$fullbases pack-$name\"\n \tchmod a-w \"$PACKTMP-$name.pack\"\n \tchmod a-w \"$PACKTMP-$name.idx\"\n \tif test \"$quiet\" != '-q'; then\n@@ -105,8 +106,8 @@ then\n \t\t( cd \"$PACKDIR\" &&\n \t\t  for e in $existing\n \t\t  do\n-\t\t\tcase \"$e\" in\n-\t\t\tpack-$name) ;;\n+\t\t\tcase \" $fullbases \" in\n+\t\t\t*\\ $e\\ *) ;;\n \t\t\t*)\trm -f \"$e.pack\" \"$e.idx\" \"$e.keep\" ;;\n \t\t\tesac\n \t\t  done\n-- \n1.5.2.762.gd8c6-dirty\n"}]}