Browse Source

feat: Add git fetch and error handling to ai-rebase.sh

This change adds `git fetch` with arguments provided by the user
to ensure the script operates on the latest remote state. It also
includes `set -e` for immediate exit on errors, improving the
reliability of the script.
seno 6 days ago
parent
commit
9f50524502
1 changed files with 3 additions and 0 deletions
  1. 3 0
      ai-rebase.sh

+ 3 - 0
ai-rebase.sh

@@ -1,4 +1,5 @@
 #!/bin/bash
+set -e
 
 # Check for required Git configuration files
 if [ ! -f "$HOME/.gitconfig" ]; then
@@ -11,6 +12,8 @@ if [ ! -f "$HOME/.git-credentials" ]; then
 	exit 1
 fi
 
+git fetch "$@"
+
 docker run --rm -it \
 	-v "$(pwd):/repo" \
 	-v "$HOME/.gitconfig:/home/appuser/.gitconfig:ro" \