aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvg <vg@devys.org>2018-02-16 15:04:06 +0100
committervg <vg@devys.org>2018-02-16 15:04:06 +0100
commit620cfc0bbf6fe04d4969bfb8a875c6ee6745eb86 (patch)
tree9098584da415536958472390ef7f6a27a51f5a6d
parent14323039fe382ad2935b912bde0202d4ffc5221e (diff)
downloadscripts-620cfc0bbf6fe04d4969bfb8a875c6ee6745eb86.tar.gz
scripts-620cfc0bbf6fe04d4969bfb8a875c6ee6745eb86.tar.bz2
scripts-620cfc0bbf6fe04d4969bfb8a875c6ee6745eb86.zip
fix git-sync with better status
-rwxr-xr-xscripts/git-sync6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/git-sync b/scripts/git-sync
index 10fc0c5..fa4d786 100755
--- a/scripts/git-sync
+++ b/scripts/git-sync
@@ -32,7 +32,8 @@ fi
echo 'Sync: git autocommit'
git add -A "./$(git rev-parse --show-cdup)"
-if git commit --dry-run --short; then
+if git status --porcelain | grep -q .; then
+ git status --short
git commit -m "Auto-commit on ${hosthash}"
fi
@@ -64,7 +65,8 @@ git status --porcelain | while read -r filename; do
done
# no action is done if there is nothing to commit
-if git commit --dry-run --short; then
+if git status --porcelain | grep -q .; then
+ git status --short
git commit -m "$conflict_message"
fi