[PATCH] fast-import: support the ls command anywhere comments are accepted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The git-fast-import manual page says about both cat-blob and ls that they can
be used "anywhere in the stream that comments are accepted", but in practice
it turns out it was only true for cat-blob. This change makes fast-import
behavior match its documentation.

Signed-off-by: Mike Hommey <mh@xxxxxxxxxxxx>
---
 fast-import.c | 4 ++++
 1 file changed, 4 insertions(+)

The downside of this change is that if a script relies on the fixed behavior,
it won't work with older versions of git. I'm not sure it is better than
fixing the documentation to match the unfortunate current limitation?


diff --git a/fast-import.c b/fast-import.c
index d0bd285..7fd59ef 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1910,6 +1910,10 @@ static int read_next_command(void)
 			parse_cat_blob(p);
 			continue;
 		}
+		if (skip_prefix(command_buf.buf, "ls ", &p)) {
+			parse_ls(p, NULL);
+			continue;
+		}
 		if (command_buf.buf[0] == '#')
 			continue;
 		return 0;
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]