summaryrefslogtreecommitdiff
path: root/commit.d/40git-rm
diff options
context:
space:
mode:
Diffstat (limited to 'commit.d/40git-rm')
-rwxr-xr-xcommit.d/40git-rm12
1 files changed, 12 insertions, 0 deletions
diff --git a/commit.d/40git-rm b/commit.d/40git-rm
new file mode 100755
index 0000000..3d5289a
--- /dev/null
+++ b/commit.d/40git-rm
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+TAB=" "
+
+if [ "$VCS" = git ] && [ -d .git ]; then
+ for file in $(git ls-files --deleted); do
+ if [ ! -d "$file" ]; then
+ git rm --quiet "$file"
+ fi
+ done
+fi