Skip to content

Commit

Permalink
Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Mar 7, 2008
1 parent 3296766 commit 971dfa1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions builtin-mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec,
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;
Expand All @@ -33,11 +32,8 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec,
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)
Expand Down

0 comments on commit 971dfa1

Please sign in to comment.