X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-repack.sh;h=8bf66a4fe8be4bf9e651e71b43268c54d9617776;hb=d01fb92f8d27cf8f0a843f4e9c0f8f022856b34d;hp=17e24526c279467891389295a55f8f257ca0d01b;hpb=e0d68cd5d95fc15342db38c211f71efe5bcfbe94;p=git.git diff --git a/git-repack.sh b/git-repack.sh index 17e24526c..8bf66a4fe 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -8,7 +8,7 @@ SUBDIRECTORY_OK='Yes' . git-sh-setup no_update_info= all_into_one= remove_redundant= -local= quiet= no_reuse_delta= extra= +local= quiet= no_reuse= extra= while case "$#" in 0) break ;; esac do case "$1" in @@ -16,7 +16,7 @@ do -a) all_into_one=t ;; -d) remove_redundant=t ;; -q) quiet=-q ;; - -f) no_reuse_delta=--no-reuse-delta ;; + -f) no_reuse=--no-reuse-object ;; -l) local=--local ;; --window=*) extra="$extra $1" ;; --depth=*) extra="$extra $1" ;; @@ -28,7 +28,7 @@ done # Later we will default repack.UseDeltaBaseOffset to true default_dbo=false -case "`git repo-config --bool repack.usedeltabaseoffset || +case "`git config --bool repack.usedeltabaseoffset || echo $default_dbo`" in true) extra="$extra --delta-base-offset" ;; @@ -45,20 +45,30 @@ case ",$all_into_one," in args='--unpacked --incremental' ;; ,t,) - args= - - # Redundancy check in all-into-one case is trivial. - existing=`test -d "$PACKDIR" && cd "$PACKDIR" && \ - find . -type f \( -name '*.pack' -o -name '*.idx' \) -print` + if [ -d "$PACKDIR" ]; then + for e in `cd "$PACKDIR" && find . -type f -name '*.pack' \ + | sed -e 's/^\.\///' -e 's/\.pack$//'` + do + if [ -e "$PACKDIR/$e.keep" ]; then + : keep + else + args="$args --unpacked=$e.pack" + existing="$existing $e" + fi + done + fi + [ -z "$args" ] && args='--unpacked --incremental' ;; esac -args="$args $local $quiet $no_reuse_delta$extra" -name=$(git-pack-objects --non-empty --all $args