[PATCH] fix handling of multiple untracked files for git mv -k
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Jan 14, 2009, 15:42 UTC
- Message-ID
- <1231947737-23803-1-git-send-email-git@drmicha.warpmail.net>
- In-Reply-To
- <vpqwscy81o8.fsf@bauges.imag.fr>
The "-k" option to "git mv" should allow specifying multiple untracked files. Currently, multiple untracked files raise an assertion if they appear consecutively as arguments. Fix this by decrementing the loop index after removing one entry from the array of arguments.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> --- builtin-mv.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Reported by the OP. Do we need a test case for this? It's a really trivial change. The patch is off master but builtin-mv.c hasn't change since 81dc2307d0ad87a4da2e753a9d1b5586d6456eed tags/v1.6.0-rc1~1, so I suggest this patch for maint.
diff --git a/builtin-mv.c b/builtin-mv.c index 4f65b5a..bce9959 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -192,6 +192,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix) memmove(destination + i, destination + i + 1, (argc - i) * sizeof(char *)); + i--; } } else die ("%s, source=%s, destination=%s",
-- 1.6.0.6