git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
PRPavel Roskin <proski@gnu.org>
Date
Sep 23, 2005, 22:12 UTC
Message-ID
<1127513570.4708.4.camel@dv>
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>
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
Message 1 of 1 in “: cg-clean confused by symlinks to directories”
  1. : cg-clean confused by symlinks to directoriesPavel Roskin, Sep 23, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.