From 4b36e2bd13c9a4f3fea4c55357c4165e2efc5446 Mon Sep 17 00:00:00 2001
From: fortandh <fortandh@qq.com>
Date: Sun, 28 Jul 2024 08:39:20 +0800
Subject: [PATCH] Fix: fix the bug with double parentheses

---
 SE/git.adoc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/SE/git.adoc b/SE/git.adoc
index e511043..b0732a0 100644
--- a/SE/git.adoc
+++ b/SE/git.adoc
@@ -15,7 +15,7 @@
 [alias]
     my-amend = "!f() { \
         git log -1; \
-        if (( $? != 0 )); then \
+        if [ $? -ne 0 ]; then \
             exit 1; \
         fi; \
         read -p \"Choose an option: (a) amend without message, (n) abort, (m) amend with new message, (c) commit with new message): \" choice; \
@@ -23,7 +23,8 @@
             a) git commit --amend --no-edit;; \
             n) echo \"Amend aborted\";; \
             m) git commit --amend;; \
-            c) read -p \"Enter commit message (one line): \" commit_msg; git commit -m \"$commit_msg\";; \
+            c) read -p \"Enter commit message (one line): \" commit_msg; \
+               git commit -m \"$commit_msg\";; \
             *) echo \"Invalid choice. Amend aborted.\"; exit 1;; \
         esac; \
     }; f"
@@ -36,7 +37,7 @@
 [alias]
     my-reset = "!f() { \
         git fetch --all; \
-        if (( $? != 0 )); then \
+        if [ $? -ne 0 ]; then \
             exit 1; \
         fi; \
         if [ \"$(git symbolic-ref --short -q HEAD)\" != \"main\" ]; then \
-- 
GitLab