X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7003-filter-branch.sh;h=e0227730deb88413301b37501fdb165a2c90460e;hb=02567e88ee8bdbf4d3852c2d6b9e5ce64a55a9e6;hp=501c207321265cc0603a8070dccb04423bfb97c5;hpb=77f2e4f5f3e448794fd4fa80e898e4388042fabb;p=git.git diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 501c20732..e0227730d 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -310,6 +310,24 @@ test_expect_success '--remap-to-ancestor with filename filters' ' test $orig_invariant = $(git rev-parse invariant) ' +test_expect_success 'automatic remapping to ancestor with filename filters' ' + git checkout master && + git reset --hard A && + test_commit add-foo2 foo 1 && + git branch moved-foo2 && + test_commit add-bar2 bar a && + git branch invariant2 && + orig_invariant=$(git rev-parse invariant2) && + git branch moved-bar2 && + test_commit change-foo2 foo 2 && + git filter-branch -f \ + moved-foo2 moved-bar2 A..master \ + -- -- foo && + test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) && + test $(git rev-parse moved-foo2) = $(git rev-parse master^) && + test $orig_invariant = $(git rev-parse invariant2) +' + test_expect_success 'setup submodule' ' rm -fr ?* .git && git init &&