Thread (6 messages) flat view 6 messages, 4 authors, 2016-07-16
STALE3714d

[PATCH] git-clean: remove fifo, devices, socket files

From: Andrey Vagin <hidden>
Date: 2016-07-15 02:43:19
Subsystem: the rest · Maintainer: Linus Torvalds

Currently git-clean removes only links and files, but
there can be special files like fifo, sockets, devices.

I think git-clean has to remove them too.

Signed-off-by: Andrey Vagin <redacted>
---
 cache.h | 8 ++++++++
 dir.c   | 4 ++++
 2 files changed, 12 insertions(+)
diff --git a/cache.h b/cache.h
index f1dc289..a2f1258 100644
--- a/cache.h
+++ b/cache.h
@@ -77,10 +77,18 @@ struct object_id {
 #undef DT_DIR
 #undef DT_REG
 #undef DT_LNK
+#undef DT_FIFO
+#undef DT_BLK
+#undef DT_CHR
+#undef DT_SOCK
 #define DT_UNKNOWN	0
 #define DT_DIR		1
 #define DT_REG		2
 #define DT_LNK		3
+#define DT_FIFO		4
+#define DT_BLK		5
+#define DT_CHR		6
+#define DT_SOCK		7
 #define DTYPE(de)	DT_UNKNOWN
 #endif
 
diff --git a/dir.c b/dir.c
index 6172b34..930dd99 100644
--- a/dir.c
+++ b/dir.c
@@ -1470,8 +1470,12 @@ static enum path_treatment treat_one_path(struct dir_struct *dir,
 		strbuf_addch(path, '/');
 		return treat_directory(dir, untracked, path->buf, path->len,
 				       baselen, exclude, simplify);
+	case DT_BLK:
+	case DT_CHR:
+	case DT_FIFO:
 	case DT_REG:
 	case DT_LNK:
+	case DT_SOCK:
 		return exclude ? path_excluded : path_untracked;
 	}
 }
-- 
2.5.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help