summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 972b9a8)
raw | patch | inline | side by side (parent: 972b9a8)
author | Adeodato Simó <dato@net.com.org.es> | |
Fri, 7 Mar 2008 20:22:17 +0000 (21:22 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 8 Mar 2008 18:46:10 +0000 (10:46 -0800) |
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ó <dato@net.com.org.es>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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ó <dato@net.com.org.es>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c | patch | blob | history | |
t/t9300-fast-import.sh | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 9b71ccc479352c6a37b9b9652f1cb1793fdbb01b..32ec159915611f6a21c218969bf82a09b6720c48 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
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;
}
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 0595041af5d310f905306c6a289945cde26d88fc..142d42f3b3f41adc99ada33d5ccac50739fb8a69 100755 (executable)
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
COMMIT
reset refs/tags/O3-2nd
from :5
+reset refs/tags/O3-3rd
+from :5
INPUT_END
cat >expect <<INPUT_END