From 1fdb649c6ac4cfc536983077b4851a1959cbc1c4 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 1 Aug 2007 02:22:53 -0400 Subject: Make trailing LF optional for all fast-import commands For the same reasons as the prior change we want to allow frontends to omit the trailing LF that usually delimits commands. In some cases these just make the input stream more verbose looking than it needs to be, and its just simpler for the frontend developer to get started if our parser is slightly more lenient about where an LF is required and where it isn't. To make this optional LF feature work we now have to buffer up to one line of input in command_buf. This buffering can happen if we look at the current input command but don't recognize it at this point in the code. In such a case we need to "unget" the entire line, but we cannot depend upon the stdio library to let us do ungetc() for that many characters at once. Signed-off-by: Shawn O. Pearce --- t/t9300-fast-import.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 't/t9300-fast-import.sh') diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 5be6f196bd..5d82b0f1ce 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -839,4 +839,50 @@ test_expect_success \ 'git-fast-import input < $GIT_COMMITTER_DATE +data < $GIT_COMMITTER_DATE +data < $GIT_COMMITTER_DATE +data < $GIT_COMMITTER_DATE +data <expect <actual && + git diff expect actual' + test_done -- cgit v1.2.3