From: Nguyễn Thái Ngọc Duy Date: Mon, 09 Mar 2015 10:18:21 GMT Subject: [PATCH 03/16] list-files: show paths relative to cwd Message-ID: <1425896314-10941-4-git-send-email-pclouds@gmail.com> In-Reply-To: <1425896314-10941-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/list-files.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/list-files.c b/builtin/list-files.c index b99f2b7..c444a53 100644 --- a/builtin/list-files.c +++ b/builtin/list-files.c @@ -3,6 +3,7 @@ #include "parse-options.h" #include "pathspec.h" #include "dir.h" +#include "quote.h" static struct pathspec pathspec; static const char *prefix; @@ -22,7 +23,7 @@ static void add_one(struct string_list *result, const char *name) struct strbuf sb = STRBUF_INIT; struct string_list_item *item; - strbuf_addstr(&sb, name); + quote_path_relative(name, prefix_length ? prefix : NULL, &sb); item = string_list_append(result, strbuf_detach(&sb, NULL)); item->util = (char *)name; } -- 2.3.0.rc1.137.g477eb31