Bläddra i källkod

chore: Improve script for fetching remote branches

This commit refactors the `ai-rebase.sh` script to correctly
fetch remote branches specified as "owner/branch".  It also
adds a conditional to avoid fetch when deleting backups,
improving script robustness and preventing errors.
seno 6 dagar sedan
förälder
incheckning
dc15cccc8f
1 ändrade filer med 5 tillägg och 3 borttagningar
  1. 5 3
      ai-rebase.sh

+ 5 - 3
ai-rebase.sh

@@ -15,10 +15,12 @@ if [ ! -f "$HOME/.git-credentials" ]; then
 	exit 1
 fi
 
-IFS='/' read -r part1 part2 <<<"$1"
+if [ ! "$1" = "--delete-backups" ]; then
+	IFS='/' read -r part1 part2 <<<"$1"
 
-echo git fetch $part1 $part2
-git fetch $part1 $part2
+	echo git fetch $part1 $part2
+	git fetch $part1 $part2
+fi
 
 docker run --rm -it \
 	-v "$(pwd):/repo" \