X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-repack.sh;h=430ddc5a706945035149464d0bea8f25acc21d3c;hb=3e9fabc85ef44fa0f275dd89738a2dacb7b6f5db;hp=49547a77c75356fb12dc3c9451a8983e06f81240;hpb=f7aac2eac96b637755c89c2405a41749c8f6033a;p=git.git diff --git a/git-repack.sh b/git-repack.sh index 49547a77..430ddc5a 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -3,7 +3,7 @@ # Copyright (c) 2005 Linus Torvalds # -. git-sh-setup || die "Not a git archive" +. git-sh-setup no_update_info= all_into_one= remove_redundant= local= while case "$#" in 0) break ;; esac @@ -11,7 +11,7 @@ do case "$1" in -n) no_update_info=t ;; -a) all_into_one=t ;; - -d) remove_redandant=t ;; + -d) remove_redundant=t ;; -l) local=t ;; *) break ;; esac @@ -32,8 +32,8 @@ case ",$all_into_one," in rev_list= rev_parse='--all' pack_objects= - # This part is a stop-gap until we have proper pack redundancy - # checker. + + # Redundancy check in all-into-one case is trivial. existing=`cd "$PACKDIR" && \ find . -type f \( -name '*.pack' -o -name '*.idx' \) -print` ;; @@ -41,7 +41,7 @@ esac if [ "$local" ]; then pack_objects="$pack_objects --local" fi -name=$(git-rev-list --objects $rev_list $(git-rev-parse $rev_parse) | +name=$(git-rev-list --objects $rev_list $(git-rev-parse $rev_parse) 2>&1 | git-pack-objects --non-empty $pack_objects .tmp-pack) || exit 1 if [ -z "$name" ]; then @@ -56,12 +56,13 @@ mv .tmp-pack-$name.pack "$PACKDIR/pack-$name.pack" && mv .tmp-pack-$name.idx "$PACKDIR/pack-$name.idx" || exit -if test "$remove_redandant" = t +if test "$remove_redundant" = t then - # We know $existing are all redandant only when + # We know $existing are all redundant only when # all-into-one is used. if test "$all_into_one" != '' && test "$existing" != '' then + sync ( cd "$PACKDIR" && for e in $existing do