[PATCH 108/144] do not reformat if there are uncommitted changes
authorAndreas Beckmann <anbe@debian.org>
Wed, 1 Dec 2021 18:43:40 +0000 (19:43 +0100)
committerAndreas Beckmann <anbe@debian.org>
Fri, 7 Jan 2022 23:55:22 +0000 (23:55 +0000)
Gbp-Pq: Name 0108-do-not-reformat-if-there-are-uncommitted-changes.patch

tools/scripts/format-branch.sh
tools/scripts/format-last-commit.sh

index b1bcf8f905d8dbc4c849e8c98f6dde56da7ca350..fe532dced248ef1173694942e4d9b4d2b39ec9ba 100755 (executable)
@@ -5,6 +5,12 @@ if [ ! -e .git ]; then
   exit 1
 fi
 
+case "$(git describe --always --dirty=-DIRTY)" in
+  *-DIRTY)
+    echo "There are uncommitted changes - aborting."
+    exit 1
+esac
+
 PATCHY=/tmp/p.patch
 
 rm -f $PATCHY
index 5bd5e78f8451521a32a708616be9ffe5114b382b..3040b93f87d3b1078d25f74f7947e44cf73001c8 100755 (executable)
@@ -5,6 +5,12 @@ if [ ! -e .git ]; then
   exit 1
 fi
 
+case "$(git describe --always --dirty=-DIRTY)" in
+  *-DIRTY)
+    echo "There are uncommitted changes - aborting."
+    exit 1
+esac
+
 PATCHY=/tmp/p.patch
 
 rm -f $PATCHY