diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-10-20 15:22:39 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-20 15:22:39 -0700 |
commit | 44a9b53c599447a706dd4ae8a00fd8b4bed093b9 (patch) | |
tree | c74c4e45ebad4b84b0651f05c6920db447af34fd | |
parent | 1b5ffa36cb02103057e5de8de8bf86419bc5502f (diff) | |
parent | a5a4b3ff4d73be736984fd499551b1b0c10d33a1 (diff) | |
download | git-44a9b53c599447a706dd4ae8a00fd8b4bed093b9.tar.gz git-44a9b53c599447a706dd4ae8a00fd8b4bed093b9.tar.xz |
Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint
A recent "filter-branch --msg-filter" broke skipping of the commit
object header, which is fixed.
* jk/filter-branch-use-of-sed-on-incomplete-line:
filter-branch: remove multi-line headers in msg filter
-rwxr-xr-x | git-filter-branch.sh | 2 | ||||
-rwxr-xr-x | t/t7003-filter-branch.sh | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 5b3f63d8b..fff8093d4 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -347,7 +347,7 @@ while read commit parents; do fi { - while read -r header_line && test -n "$header_line" + while IFS='' read -r header_line && test -n "$header_line" do # skip header lines... :; diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 855afda80..377c648e0 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -2,6 +2,7 @@ test_description='git filter-branch' . ./test-lib.sh +. "$TEST_DIRECTORY/lib-gpg.sh" test_expect_success 'setup' ' test_commit A && @@ -292,6 +293,19 @@ test_expect_success 'Tag name filtering strips gpg signature' ' test_cmp expect actual ' +test_expect_success GPG 'Filtering retains message of gpg signed commit' ' + mkdir gpg && + touch gpg/foo && + git add gpg && + test_tick && + git commit -S -m "Adding gpg" && + + git log -1 --format="%s" > expect && + git filter-branch -f --msg-filter "cat" && + git log -1 --format="%s" > actual && + test_cmp expect actual +' + test_expect_success 'Tag name filtering allows slashes in tag names' ' git tag -m tag-with-slash X/1 && git cat-file tag X/1 | sed -e s,X/1,X/2, > expect && |