summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/claude-inbox.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/claude-inbox.nix b/pkgs/claude-inbox.nix
index 86bedcf..5920440 100644
--- a/pkgs/claude-inbox.nix
+++ b/pkgs/claude-inbox.nix
@@ -218,6 +218,13 @@ let
# master, renamed, and a new one, of BRANCH, with the old one's
# upstream (which the rename took along)
old=abandoned/master-$(date -Is | tr : -) # no : in branch names
+ i=1
+ s=
+ while git -C "$r" rev-parse -q --verify "refs/heads/$old$s" >/dev/null; do
+ i=$((i + 1)) # another in the same second: -2, -3, ...
+ s=-$i
+ done
+ old=$old$s
up=$(git -C "$r" rev-parse -q --verify --abbrev-ref 'master@{upstream}' 2>/dev/null || :)
git -C "$r" branch -m master "$old"
if ! git -C "$r" switch -q --no-track -c master "claude/$b"; then