Skip to contentSkip to conversation

Teach git-gc to only repack local (not borrowed) objects.

PATCH New Shawn O. Pearce 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Teach git-gc to only repack local (not borrowed) objects.

This feature was suggested by Martin Waitz on the git mailing list and is actually the correct thing to do. If the current repository is borrowing objects from repository then this repository is not usually considered to be maintaining the objects which are available through that other repository's object database. We really should only repack objects which are stored directly in this repository, so supply -l to git-repack.

---
 git-gc.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-gc.sh +1 -1
index e55ed19..6de55f7 100755
@@ -10,6 +10,6 @@ SUBDIRECTORY_OK=Yes
 
 git-pack-refs --prune &&
 git-reflog expire --all &&
-git-repack -a -d &&
+git-repack -a -d -l &&
 git-prune &&
 git-rerere gc || exit
Signature · 1 line
1.4.4.3.gd2e4