threads / patch / 1927

patch: cg-clean confused by symlinks to directories

Subject: [PATCH]: cg-clean confused by symlinks to directories

## tl;dr

One message between Sep 23, 2005 and Sep 23, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Pavel Roskin· Sep 23, 2005, 22:12 UTC · lore
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.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Show changes to cg-clean +1 −1
diff --git a/cg-clean b/cg-clean
--- a/cg-clean
+++ b/cg-clean
@@ -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
-- 
Regards,
Pavel Roskin

← back to recent threads