Skip to content

Commit

Permalink
speedup and fix for tree-filter not removing pure .subrepo folder com…
Browse files Browse the repository at this point in the history
…mits
  • Loading branch information
wkornewald committed May 27, 2016
1 parent 6f41f6f commit 4e34c85
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions git-srepo
Expand Up @@ -270,14 +270,16 @@ build() {
# Check if subdir has a parent revision (localrev), at all.
# There is no parent on first export or after import into an empty repo.
if [ "$localrev" ]; then
git filter-branch -f --parent-filter "grep -v $localrev || true" \
--subdirectory-filter "$subdir" \
--tree-filter "rm -rf .subrepo" \
-- "$localrev"..HEAD
git filter-branch -f --prune-empty \
--parent-filter "grep -v $localrev || true" \
--subdirectory-filter "$subdir" \
--index-filter 'git rm -r --ignore-unmatch --cached .subrepo' \
-- "$localrev"..HEAD
else
git filter-branch -f --subdirectory-filter "$subdir" \
--tree-filter "rm -rf .subrepo" \
-- HEAD
git filter-branch -f --prune-empty \
--subdirectory-filter "$subdir" \
--index-filter 'git rm -r --ignore-unmatch --cached .subrepo' \
-- HEAD
fi

local torebase="$(git rev-list HEAD | count-lines)"
Expand Down

0 comments on commit 4e34c85

Please sign in to comment.