summaryrefslogtreecommitdiff
path: root/t/t2030-unresolve-info.sh
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2013-04-01 21:36:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-02 20:00:41 (GMT)
commit53d8afafbbf455d24b0a94e4114709a4d495d460 (patch)
tree72e962bc7cc59eef2bd01fc4f422dca3b8462eab /t/t2030-unresolve-info.sh
parent15999998fbda60552742275570947431b57108ae (diff)
downloadgit-53d8afafbbf455d24b0a94e4114709a4d495d460.zip
git-53d8afafbbf455d24b0a94e4114709a4d495d460.tar.gz
git-53d8afafbbf455d24b0a94e4114709a4d495d460.tar.bz2
rerere forget: grok files containing NUL
Using 'git rerere forget .' after a merge that involved binary files runs into an infinite loop if the binary file contains a zero byte. Replace a strchrnul by memchr because the former does not make progress as soon as the NUL is encountered. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2030-unresolve-info.sh')
-rwxr-xr-xt/t2030-unresolve-info.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index f262065..0b699f5 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -44,9 +44,13 @@ prime_resolve_undo () {
test_expect_success setup '
mkdir fi &&
+ printf "a\0a" >binary &&
+ git add binary &&
test_commit initial fi/le first &&
git branch side &&
git branch another &&
+ printf "a\0b" >binary &&
+ git add binary &&
test_commit second fi/le second &&
git checkout side &&
test_commit third fi/le third &&
@@ -167,4 +171,12 @@ test_expect_success 'rerere and rerere forget (subdirectory)' '
test_cmp expect actual
'
+test_expect_success 'rerere forget (binary)' '
+ git checkout -f side &&
+ printf "a\0c" >binary &&
+ git commit -a -m binary &&
+ test_must_fail git merge second &&
+ git rerere forget binary
+'
+
test_done