Skip to contentSkip to conversation

: cg-clean confused by symlinks to directories

PATCH New Pavel Roskin 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : cg-clean confused by symlinks to directories

cg-clean confused by symlinks to directories

It turns out that "git-ls-files --others" shows symlinks to directories. That shouldn't trigger internal error in cg-clean. Such symlinks should be treated like files and removed even without the "-d" option.

cg-clean +1 -1
@@ -111,7 +111,7 @@ clean_files()
 	cg-status "$xopt" -w | sed -n 's/^? //p' |
 	for file in $(cat); do
 		path="${_git_relpath}$file"
-		if [ -d "$path" ]; then
+		if [ -d "$path" -a ! -L "$path" ]; then
 			# Sanity check, shouldn't happen
 			echo "FATAL: cg-status reports directories (internal error)" >&2
 			exit 1
Signature · 2 lines
Regards,
Pavel Roskin