From 655e8515f279c01f525745d443f509f97cd805ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Fri, 7 Mar 2008 21:22:17 +0100 Subject: Really make the LF after reset in fast-import optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cmd_from() ends with a call to read_next_command(), which is needed when using cmd_from() from commands where from is not the last element. With reset, however, "from" is the last command, after which the flow returns to the main loop, which calls read_next_command() again. Because of this, always set unread_command_buf in cmd_reset_branch(), even if cmd_from() was successful. Add a test case for this in t9300-fast-import.sh. Signed-off-by: Adeodato Simó Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- fast-import.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fast-import.c') diff --git a/fast-import.c b/fast-import.c index 9b71ccc47..32ec15991 100644 --- a/fast-import.c +++ b/fast-import.c @@ -2261,7 +2261,8 @@ static void cmd_reset_branch(void) else b = new_branch(sp); read_next_command(); - if (!cmd_from(b) && command_buf.len > 0) + cmd_from(b); + if (command_buf.len > 0) unread_command_buf = 1; } -- cgit v1.2.1