All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-clean: remove fifo, devices, socket files
@ 2016-07-15  2:42 Andrey Vagin
  2016-07-15  5:56 ` Johannes Sixt
  0 siblings, 1 reply; 6+ messages in thread
From: Andrey Vagin @ 2016-07-15  2:42 UTC (permalink / raw)
  To: gitster; +Cc: git, Andrey Vagin

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 <avagin@openvz.org>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-16  8:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  2:42 [PATCH] git-clean: remove fifo, devices, socket files Andrey Vagin
2016-07-15  5:56 ` Johannes Sixt
2016-07-15  7:46   ` Andrey Vagin
2016-07-15 10:48     ` Johannes Schindelin
2016-07-15 20:33     ` Johannes Sixt
2016-07-15 21:36       ` Andrew Vagin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.