Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-17 00:42:47 +0300
committerJunio C Hamano <gitster@pobox.com>2015-10-17 00:42:47 +0300
commit1551511bdbeb893a604234130544dda11ab8488d (patch)
tree126e0a1bffda9580a79938fffc4e3da16aa34cb0
parentc6185c0b17636a9178bc3047ed90c071ca062a51 (diff)
parenta5a4b3ff4d73be736984fd499551b1b0c10d33a1 (diff)
Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line'
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-xgit-filter-branch.sh2
-rwxr-xr-xt/t7003-filter-branch.sh14
2 files changed, 15 insertions, 1 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 5777947a5d..27c9c54fbd 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -377,7 +377,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 855afda80a..377c648e04 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 &&