summaryrefslogtreecommitdiff
path: root/pre-commit.d
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-03-20 22:50:51 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-03-20 22:50:51 -0400
commit617228b8b30f7a32d256a2a744de0047fb494d69 (patch)
tree76b18c5e3a2d89769d7c591c6897b3851128e725 /pre-commit.d
parent34172d87ef01b4c015f66b06d5088ae7d1d2d0b9 (diff)
remove .metadata first so .etckeeper doesn't try to chmod it
Also, remove vcs test, as it's in a code block that already tests that.
Diffstat (limited to 'pre-commit.d')
-rwxr-xr-xpre-commit.d/30store-metadata10
1 files changed, 5 insertions, 5 deletions
diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata
index e5dcd77..ec0c691 100755
--- a/pre-commit.d/30store-metadata
+++ b/pre-commit.d/30store-metadata
@@ -54,6 +54,11 @@ generate_metadata() {
if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then
+ if [ -f .metadata ]; then
+ # remove obsolete .metadata file
+ $VCS rm .metadata
+ fi
+
echo "# Generated by etckeeper. Do not edit." > .etckeeper
echo >> .etckeeper
@@ -70,9 +75,4 @@ if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then
fi
# hg and bzr add not done, they will automatically
# include the file in the current commit
-
- # Finally, VCS remove obsolete .metadata (as long as VCS is set)
- if [ -f .metadata ] && [ "x$VCS" != "x" ]; then
- $VCS rm .metadata
- fi
fi