summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2019-02-20 22:58:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 02:59:09 (GMT)
commitcf7b857a77bda6a9a93e2cde2f6ae1764e7a2517 (patch)
tree7e8b94a8f8789f27c9c004d696a604b5b8a714f0 /t
parent7ffde293f2e7f0ae455800b138416da601254436 (diff)
downloadgit-cf7b857a77bda6a9a93e2cde2f6ae1764e7a2517.zip
git-cf7b857a77bda6a9a93e2cde2f6ae1764e7a2517.tar.gz
git-cf7b857a77bda6a9a93e2cde2f6ae1764e7a2517.tar.bz2
fast-import: fix erroneous handling of get-mark with empty orphan commits
When get-mark was introduced in commit 28c7b1f7b7b7 ("fast-import: add a get-mark command", 2015-07-01), it followed the precedent of the cat-blob command to be allowed on any line other than in the middle of a data directive; see commit 777f80d7429b ("fast-import: Allow cat-blob requests at arbitrary points in stream", 2010-11-28). It was useful to allow cat-blob directives in the middle of a commit to get more data that would be used in writing the current commit object. get-mark is not similarly useful since fast-import can already use either object id or mark. Further, trying to allow this command anywhere caused parsing bugs. Fix the parsing problems by only allowing get-mark commands to appear when other commands have completed. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9300-fast-import.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index c304c8c..3668263 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -3276,11 +3276,11 @@ cat >>W-input <<-W_INPUT_END
LFsget-mark :1
W_INPUT_END
-test_expect_failure !MINGW 'W: get-mark & empty orphan commit with no newlines' '
+test_expect_success !MINGW 'W: get-mark & empty orphan commit with no newlines' '
sed -e s/LFs// W-input | tr L "\n" | git fast-import
'
-test_expect_failure !MINGW 'W: get-mark & empty orphan commit with one newline' '
+test_expect_success !MINGW 'W: get-mark & empty orphan commit with one newline' '
sed -e s/LFs/L/ W-input | tr L "\n" | git fast-import
'