Skip to content

Commit 05f43df

Browse files
arichardsonjameswalmsley
authored andcommitted
Use git-filter-branch --index-filter instead of --tree-filter
Using an index filter is much faster since git does not have to perform a full checkout for every commit in the range that needs to be rewritten. Fixes ingydotnet#435
1 parent 550e736 commit 05f43df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/git-subrepo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,8 @@ subrepo:branch() {
821821
o "Remove the .gitrepo file from $first_gitrepo_commit..$branch"
822822
local filter=$branch
823823
[[ $first_gitrepo_commit ]] && filter=$first_gitrepo_commit..$branch
824-
FAIL=false RUN git filter-branch -f --prune-empty --tree-filter \
825-
"rm -f .gitrepo" "$filter"
824+
FAIL=false RUN git filter-branch -f --prune-empty --index-filter \
825+
'git rm --cached --ignore-unmatch .gitrepo' "$filter"
826826

827827
git:create-worktree "$branch"
828828

0 commit comments

Comments
 (0)