mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
wt-status.c:quote_path(): convert empty path to "./"
Now that we are correctly removing leading prefixes from files in git status, there is a degenerate case: the directory matching the prefix. Because we show only the directory name for a directory that contains only untracked files, it gets collapsed to an empty string. Example: $ git init $ mkdir subdir $ touch subdir/file $ git status ... # Untracked files: # (use "git add <file>..." to include in what will be committed) # # subdir/ So far, so good. $ cd subdir $ git status .... # Untracked files: # (use "git add <file>..." to include in what will be committed) # # Oops, that's a bit confusing. This patch prints './' to show that there is some output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
235997c90f
commit
c3ce326128
|
@ -121,6 +121,9 @@ static char *quote_path(const char *in, int len,
|
|||
}
|
||||
}
|
||||
|
||||
if (!out->len)
|
||||
strbuf_addstr(out, "./");
|
||||
|
||||
return out->buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue