From 26a46bf2fd473122e53a3303226b093523d30bfd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 13 Nov 2007 19:09:10 -0500 Subject: * 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. --- post-apt.d/50git-commit | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'post-apt.d/50git-commit') diff --git a/post-apt.d/50git-commit b/post-apt.d/50git-commit index 30ef0f2..6eb3434 100755 --- a/post-apt.d/50git-commit +++ b/post-apt.d/50git-commit @@ -1,9 +1,12 @@ #!/bin/sh set -e -# TODO: figure out what packages were acted on by the apt run, and include -# that info in the commit message -message="committing changes after apt run" +if [ -d .git ]; then -# ignore exit code since it exits nonzero if there is nothing to do -git commit -m "$message" || true + # TODO: figure out what packages were acted on by the apt run, and + # include that info in the commit message + message="committing changes after apt run" + + # ignore exit code since it exits nonzero if there is nothing to do + git commit -m "$message" || true +fi -- cgit v1.2.3