Skip to content

Commit 3fc0046

Browse files
arichardsondoak
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 1dea310 commit 3fc0046

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
@@ -843,8 +843,8 @@ subrepo:branch() {
843843
o "Remove the .gitrepo file from $first_gitrepo_commit..$branch"
844844
local filter=$branch
845845
[[ $first_gitrepo_commit ]] && filter=$first_gitrepo_commit..$branch
846-
FAIL=false RUN git filter-branch -f --prune-empty --tree-filter \
847-
"rm -f .gitrepo" "$filter"
846+
FAIL=false RUN git filter-branch -f --prune-empty --index-filter \
847+
'git rm --cached --ignore-unmatch .gitrepo' "$filter"
848848

849849
git:create-worktree "$branch"
850850

0 commit comments

Comments
 (0)