From 3c730fab2cae1bb52d34620af170a628b3b8c537 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 18 Oct 2012 06:33:02 -0400 Subject: filter-branch: use git-sh-setup's ident parsing functions This saves us some code, but it also reduces the number of processes we start for each filtered commit. Since we can parse both author and committer in the same sed invocation, we save one process. And since the new interface avoids tr, we save 4 processes. It also avoids using "tr", which has had some odd portability problems reported with from Solaris's xpg6 version. We also tweak one of the tests in t7003 to double-check that we are properly exporting the variables (because test-lib.sh exports GIT_AUTHOR_NAME, it will be automatically exported in subprograms. We override this to make sure that filter-branch handles it properly itself). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t7003-filter-branch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 't/t7003-filter-branch.sh') diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 4d13e10de1..1e7a209efa 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -167,10 +167,11 @@ test_expect_success 'author information is preserved' ' test_tick && GIT_AUTHOR_NAME="B V Uips" git commit -m bvuips && git branch preserved-author && - git filter-branch -f --msg-filter "cat; \ + (sane_unset GIT_AUTHOR_NAME && + git filter-branch -f --msg-filter "cat; \ test \$GIT_COMMIT != $(git rev-parse master) || \ echo Hallo" \ - preserved-author && + preserved-author) && test 1 = $(git rev-list --author="B V Uips" preserved-author | wc -l) ' -- cgit v1.2.3