@matheusbsbs / matheus-bagliano / commits / f7aac2eac9
Fork 0

Add "-l" flag for repacking only local packs

This uses the new "--local" flag to git-pack-objects. It currently only makes a difference together with "-a", since a normal incremental repack won't pack any packed objects at all (whether local or remote). Eventually, it might end up skipping any objects that aren't local to the current object directory, but for now it only knows to skip packed objects. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Linus Torvalds committed Oct 13, 2005 at 15:38 UTC f7aac2eac96b637755c89c2405a41749c8f6033a
1 file changed +5 -1
git-repack.sh
+5 -1
@@ -5,13 +5,14 @@
5
6 . git-sh-setup || die "Not a git archive"
7
8 -no_update_info= all_into_one= remove_redundant=
8 +no_update_info= all_into_one= remove_redundant= local=
9 while case "$#" in 0) break ;; esac
10 do
11 case "$1" in
12 -n) no_update_info=t ;;
13 -a) all_into_one=t ;;
14 -d) remove_redandant=t ;;
15 + -l) local=t ;;
16 *) break ;;
17 esac
18 shift
@@ -37,6 +38,9 @@ case ",$all_into_one," in
38 find . -type f \( -name '*.pack' -o -name '*.idx' \) -print`
39 ;;
40 esac
41 +if [ "$local" ]; then
42 + pack_objects="$pack_objects --local"
43 +fi
44 name=$(git-rev-list --objects $rev_list $(git-rev-parse $rev_parse) |
45 git-pack-objects --non-empty $pack_objects .tmp-pack) ||
46 exit 1