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 <junkio@cox.net>
This commit is contained in:
parent
657907e76e
commit
0907fedbee
@ -293,11 +293,12 @@ static void read_directory(const char *path, const char *base, int baselen)
|
|||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case DT_DIR:
|
case DT_DIR:
|
||||||
memcpy(fullname + baselen + len, "/", 2);
|
memcpy(fullname + baselen + len, "/", 2);
|
||||||
|
len++;
|
||||||
if (show_other_directories &&
|
if (show_other_directories &&
|
||||||
!dir_exists(fullname, baselen + len + 1))
|
!dir_exists(fullname, baselen + len))
|
||||||
break;
|
break;
|
||||||
read_directory(fullname, fullname,
|
read_directory(fullname, fullname,
|
||||||
baselen + len + 1);
|
baselen + len);
|
||||||
continue;
|
continue;
|
||||||
case DT_REG:
|
case DT_REG:
|
||||||
case DT_LNK:
|
case DT_LNK:
|
||||||
|
Loading…
Reference in New Issue
Block a user