From 2478dc84b5fb2617bfab3a8f65f1270de578b94a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 27 Feb 2009 23:58:50 -0800 Subject: git-repack: resist stray environment variable The script used $args and $existing without initializing it to empty. It would have been confused by an environment variable the end user had before running it. Signed-off-by: Junio C Hamano --- git-repack.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'git-repack.sh') diff --git a/git-repack.sh b/git-repack.sh index 458a497af8..86000151cc 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -60,6 +60,7 @@ case ",$all_into_one," in args='--unpacked --incremental' ;; ,t,) + args= existing= if [ -d "$PACKDIR" ]; then for e in `cd "$PACKDIR" && find . -type f -name '*.pack' \ | sed -e 's/^\.\///' -e 's/\.pack$//'` -- cgit v1.2.3 From 03a9683d22eca52bc2b2b9b09258a143e76416f6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 28 Feb 2009 00:00:21 -0800 Subject: Simplify is_kept_pack() This removes --unpacked= parameter from the revision parser, and rewrites its use in git-repack to pass a single --kept-pack-only option instead. The new --kept-pack-only option means just that. When this option is given, is_kept_pack() that used to say "not on the --unpacked= list" now says "the packfile has corresponding .keep file". Signed-off-by: Junio C Hamano --- git-repack.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git-repack.sh') diff --git a/git-repack.sh b/git-repack.sh index 86000151cc..a736009c67 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -68,10 +68,13 @@ case ",$all_into_one," in if [ -e "$PACKDIR/$e.keep" ]; then : keep else - args="$args --unpacked=$e.pack" existing="$existing $e" fi done + if test -n "$existing" + then + args="--kept-pack-only" + fi if test -n "$args" -a -n "$unpack_unreachable" -a \ -n "$remove_redundant" then -- cgit v1.2.3