summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3296766)
raw | patch | inline | side by side (parent: 3296766)
author | Junio C Hamano <gitster@pobox.com> | |
Fri, 7 Mar 2008 07:29:40 +0000 (23:29 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 7 Mar 2008 08:14:43 +0000 (00:14 -0800) |
When get_pathspec() was originally made absolute-path capable,
we botched the interface to it, without dying inside the function
when given a path that is outside the work tree, and made it the
responsibility of callers to check the condition in a roundabout
way. This is made unnecessary with the previous patch.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
we botched the interface to it, without dying inside the function
when given a path that is outside the work tree, and made it the
responsibility of callers to check the condition in a roundabout
way. This is made unnecessary with the previous patch.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-mv.c | patch | blob | history |
diff --git a/builtin-mv.c b/builtin-mv.c
index 68aa2a68bb8f4232732829ba7d9459bbef3c7ad5..94f6dd2aad2da512bab0be2e84859eced6553cc9 100644 (file)
--- a/builtin-mv.c
+++ b/builtin-mv.c
int count, int base_name)
{
int i;
- int len = prefix ? strlen(prefix) : 0;
const char **result = xmalloc((count + 1) * sizeof(const char *));
memcpy(result, pathspec, count * sizeof(const char *));
result[count] = NULL;
if (last_slash)
result[i] = last_slash + 1;
}
- result[i] = prefix_path(prefix, len, result[i]);
- if (!result[i])
- exit(1); /* error already given */
}
- return result;
+ return get_pathspec(prefix, result);
}
static void show_list(const char *label, struct path_list *list)