aboutsummaryrefslogtreecommitdiff
path: root/git-repack.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-16 23:24:07 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-17 23:12:11 -0700
commit65aa53029a32a1ad36523f3e7a1bb933d4494805 (patch)
treeda1645bad565c76a2258114e2962576d7dbb6a52 /git-repack.sh
parent08cdfb13374f31b0c1c47444f55042e7b72c3190 (diff)
downloadgit-65aa53029a32a1ad36523f3e7a1bb933d4494805.tar.gz
git-65aa53029a32a1ad36523f3e7a1bb933d4494805.tar.xz
repack -A -d: use --keep-unreachable when repacking
This is a safer variant of "repack -a -d" that does not drop unreachable objects that are in packs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-repack.sh')
-rwxr-xr-xgit-repack.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/git-repack.sh b/git-repack.sh
index 156c5e8f4..633b902e2 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -3,17 +3,19 @@
# Copyright (c) 2005 Linus Torvalds
#
-USAGE='[-a] [-d] [-f] [-l] [-n] [-q] [--max-pack-size=N] [--window=N] [--window-memory=N] [--depth=N]'
+USAGE='[-a|-A] [-d] [-f] [-l] [-n] [-q] [--max-pack-size=N] [--window=N] [--window-memory=N] [--depth=N]'
SUBDIRECTORY_OK='Yes'
. git-sh-setup
-no_update_info= all_into_one= remove_redundant=
+no_update_info= all_into_one= remove_redundant= keep_unreachable=
local= quiet= no_reuse= extra=
while case "$#" in 0) break ;; esac
do
case "$1" in
-n) no_update_info=t ;;
-a) all_into_one=t ;;
+ -A) all_into_one=t
+ keep_unreachable=--keep-unreachable ;;
-d) remove_redundant=t ;;
-q) quiet=-q ;;
-f) no_reuse=--no-reuse-object ;;
@@ -59,7 +61,13 @@ case ",$all_into_one," in
fi
done
fi
- [ -z "$args" ] && args='--unpacked --incremental'
+ if test -z "$args"
+ then
+ args='--unpacked --incremental'
+ elif test -n "$keep_unreachable"
+ then
+ args="$args $keep_unreachable"
+ fi
;;
esac