Don't find objects in packs which aren't available anymore.
[gitweb.git] / git-repack.sh
index f150a558ca7a7a659f4eb88be3a275e1a4e87337..ddfa8b44a17f1ea7ff039bca1d6132ba07e5cf12 100755 (executable)
@@ -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" ;;
@@ -62,11 +62,13 @@ case ",$all_into_one," in
 esac
 
 args="$args $local $quiet $no_reuse_delta$extra"
-name=$(git-pack-objects --non-empty --all $args </dev/null "$PACKTMP") ||
+name=$(git-pack-objects --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
        exit 1
 if [ -z "$name" ]; then
        echo Nothing new to pack.
 else
+       chmod a-w "$PACKTMP-$name.pack"
+       chmod a-w "$PACKTMP-$name.idx"
        if test "$quiet" != '-q'; then
            echo "Pack pack-$name created."
        fi
@@ -108,7 +110,7 @@ then
                  done
                )
        fi
-       git-prune-packed
+       git-prune-packed $quiet
 fi
 
 case "$no_update_info" in