From 620cfc0bbf6fe04d4969bfb8a875c6ee6745eb86 Mon Sep 17 00:00:00 2001 From: vg Date: Fri, 16 Feb 2018 15:04:06 +0100 Subject: fix git-sync with better status --- scripts/git-sync | 6 ++++-- 1 file 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 -- cgit v1.2.3