summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:35:29 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:06 -0700
commitd2ce1331953e9f4306e00f5edf3a6ce6e3330e9e (patch)
tree40d58e49adae53d99dbd55e4be6785b368e5a73b /pathspec.c
parent87323bdace47c3d464a783f48b16617720e8eeee (diff)
downloadgit-d2ce1331953e9f4306e00f5edf3a6ce6e3330e9e.tar.gz
parse_pathspec: save original pathspec for reporting
We usually use pathspec_item's match field for pathspec error reporting. However "match" (or "raw") does not show the magic part, which will play more important role later on. Preserve exact user input for reporting. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pathspec.c b/pathspec.c
index ce942dbccf..f94beb6075 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -203,6 +203,7 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
else
match = prefix_path(prefix, prefixlen, copyfrom);
*raw = item->match = match;
+ item->original = elt;
item->len = strlen(item->match);
if (limit_pathspec_to_literal())
item->nowildcard_len = item->len;
@@ -277,6 +278,7 @@ void parse_pathspec(struct pathspec *pathspec,
pathspec->items = item = xmalloc(sizeof(*item));
memset(item, 0, sizeof(*item));
item->match = prefix;
+ item->original = prefix;
item->nowildcard_len = item->len = strlen(prefix);
raw[0] = prefix;
raw[1] = NULL;