summaryrefslogtreecommitdiff
path: root/post-apt.d/40git-rm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2007-11-13 19:09:10 -0500
committerJoey Hess <joey@kodama.kitenet.net>2007-11-13 19:09:10 -0500
commit26a46bf2fd473122e53a3303226b093523d30bfd (patch)
tree12f7d4cd0594b371ac35f3bcf0ad4dd1a104ae8d /post-apt.d/40git-rm
parent8824d34847c9ebe106c9e362b2d1af1b031217dc (diff)
* Add tests for /etc/.git not yet existing and avoid doing bad things.
Closes: #451185 * If /etc/.git doesn't exist, display a suggestion to run etckeeper-init.
Diffstat (limited to 'post-apt.d/40git-rm')
-rwxr-xr-xpost-apt.d/40git-rm12
1 files changed, 7 insertions, 5 deletions
diff --git a/post-apt.d/40git-rm b/post-apt.d/40git-rm
index 4a47435..01161ca 100755
--- a/post-apt.d/40git-rm
+++ b/post-apt.d/40git-rm
@@ -3,8 +3,10 @@ set -e
TAB=" "
-for file in $(git ls-files --deleted); do
- if [ ! -d "$file" ]; then
- git rm "$file"
- fi
-done
+if [ -d .git ]; then
+ for file in $(git ls-files --deleted); do
+ if [ ! -d "$file" ]; then
+ git rm "$file"
+ fi
+ done
+fi