summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-05-11 14:23:54 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-05-11 14:23:54 -0700
commit02f8203740c63a2a8f2f63979b46ecfce976dfc0 (patch)
tree25e913179f0e1cca93b4065b0e16b31840bf6246 /t
parentMerge branch 'jc/daemon-no-ipv6-for-2.4.1' (diff)
parentfilter-branch: avoid passing commit message through sed (diff)
downloadtgif-02f8203740c63a2a8f2f63979b46ecfce976dfc0.tar.xz
Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line'
"filter-branch" corrupted commit log message that ends with an incomplete line on platforms with some "sed" implementations that munge such a line. Work it around by avoiding to use "sed". * jk/filter-branch-use-of-sed-on-incomplete-line: filter-branch: avoid passing commit message through sed
Diffstat (limited to 't')
-rwxr-xr-xt/t7003-filter-branch.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 66643e4bd7..855afda80a 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -394,4 +394,14 @@ test_expect_success 'replace submodule revision' '
test $orig_head != `git show-ref --hash --head HEAD`
'
+test_expect_success 'filter commit message without trailing newline' '
+ git reset --hard original &&
+ commit=$(printf "no newline" | git commit-tree HEAD^{tree}) &&
+ git update-ref refs/heads/no-newline $commit &&
+ git filter-branch -f refs/heads/no-newline &&
+ echo $commit >expect &&
+ git rev-parse refs/heads/no-newline >actual &&
+ test_cmp expect actual
+'
+
test_done