summaryrefslogtreecommitdiff
path: root/ar/.local/bin/gitupdate
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-11 09:21:30 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-11 09:21:30 +0900
commit637eaf89ba69d8e4ff49d3d5253f1f97ffb0c86c (patch)
treea286c6ee22fabb20ef7501fad05d88d751adca35 /ar/.local/bin/gitupdate
parent59ef85d49f91e8588885f575f8f9238c0eccd8b2 (diff)
modified bin/gitupdate, modified bin/xdotmouse
Diffstat (limited to 'ar/.local/bin/gitupdate')
-rwxr-xr-xar/.local/bin/gitupdate14
1 files changed, 7 insertions, 7 deletions
diff --git a/ar/.local/bin/gitupdate b/ar/.local/bin/gitupdate
index 8205e48..4fed27e 100755
--- a/ar/.local/bin/gitupdate
+++ b/ar/.local/bin/gitupdate
@@ -43,6 +43,13 @@ unpushed=$(git cherry -v | wc -l)
[ -z "$changes" ] && [ "$unpushed" -eq 0 ] && exit
+# Save current directory and change to the Git repo root
+repo_root=$(git rev-parse --show-toplevel || echo ".")
+cd "$repo_root" || exit
+
+# Get the current Git branch name
+branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
+
# Generate default commit message if there are changes
if [ -n "$changes" ] && [ "$unpushed" -eq 0 ]; then
num_changes=$(echo "$changes" | wc -l)
@@ -64,13 +71,6 @@ else
message=$(git cherry -v | awk '{$1=$2=""; print $0}' | sed 's/^ *//' | tail -n 1)
fi
-# Get the current Git branch name
-branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
-
-# Save current directory and change to the Git repo root
-repo_root=$(git rev-parse --show-toplevel || echo ".")
-cd "$repo_root"
-
if [ "$repo_root" = "${PASSWORD_STORE_DIR:-${HOME}/.password-store}" ]; then
pass git remote | xargs -L1 pass git push --all
else