{"thread":{"id":"1927","subject":"[PATCH]: cg-clean confused by symlinks to directories","startedAt":"2005-09-23T22:12:50Z","lastAt":"2005-09-23T22:12:50Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9201","messageId":"1127513570.4708.4.camel@dv","threadId":"1927","inReplyTo":null,"subject":"[PATCH]: cg-clean confused by symlinks to directories","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-09-23T22:12:50Z","receivedAt":"2005-09-23T22:12:50Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"cg-clean confused by symlinks to directories\n\nIt turns out that \"git-ls-files --others\" shows symlinks to directories.\nThat shouldn't trigger internal error in cg-clean.  Such symlinks should\nbe treated like files and removed even without the \"-d\" option.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/cg-clean b/cg-clean\n--- a/cg-clean\n+++ b/cg-clean\n@@ -111,7 +111,7 @@ clean_files()\n \tcg-status \"$xopt\" -w | sed -n 's/^? //p' |\n \tfor file in $(cat); do\n \t\tpath=\"${_git_relpath}$file\"\n-\t\tif [ -d \"$path\" ]; then\n+\t\tif [ -d \"$path\" -a ! -L \"$path\" ]; then\n \t\t\t# Sanity check, shouldn't happen\n \t\t\techo \"FATAL: cg-status reports directories (internal error)\" >&2\n \t\t\texit 1\n\n\n-- \nRegards,\nPavel Roskin\n"}]}