diff options
Diffstat (limited to 'pre-commit.d')
-rwxr-xr-x | pre-commit.d/30store-metadata | 10 |
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 |