From: Junio C Hamano Date: Sat, 7 Jan 2006 22:31:56 +0000 (-0800) Subject: ls-files --others --directory: give trailing slash X-Git-Tag: v1.1.0~8 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0907fedbeea12aa78a66b9d765b0e618a180b6ff;p=git.git ls-files --others --directory: give trailing slash This adds a trailing slash to directory names in the output when "--others --directory" option shows only untracked directories and not their contents, to make them stand out. Signed-off-by: Junio C Hamano --- diff --git a/ls-files.c b/ls-files.c index cc5b32e8..b29fe1be 100644 --- a/ls-files.c +++ b/ls-files.c @@ -293,11 +293,12 @@ static void read_directory(const char *path, const char *base, int baselen) /* fallthrough */ case DT_DIR: memcpy(fullname + baselen + len, "/", 2); + len++; if (show_other_directories && - !dir_exists(fullname, baselen + len + 1)) + !dir_exists(fullname, baselen + len)) break; read_directory(fullname, fullname, - baselen + len + 1); + baselen + len); continue; case DT_REG: case DT_LNK: