From: Andrey Vagin <avagin@openvz.org>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Andrey Vagin <avagin@openvz.org>
Subject: [PATCH] git-clean: remove fifo, devices, socket files
Date: Thu, 14 Jul 2016 19:42:59 -0700 [thread overview]
Message-ID: <1468550579-9298-1-git-send-email-avagin@openvz.org> (raw)
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
next reply other threads:[~2016-07-15 2:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 2:42 Andrey Vagin [this message]
2016-07-15 5:56 ` [PATCH] git-clean: remove fifo, devices, socket files 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468550579-9298-1-git-send-email-avagin@openvz.org \
--to=avagin@openvz.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).