From fcfdbb0e3f1d998cc4d5cb1320ab6c64b6d58a10 Mon Sep 17 00:00:00 2001 From: Jason Ansel Date: Tue, 27 May 2025 16:13:23 -0700 Subject: [PATCH] Fix bug with 'git remote set-branches origin main' --- src/stack_pr/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stack_pr/cli.py b/src/stack_pr/cli.py index d068998..51a9434 100755 --- a/src/stack_pr/cli.py +++ b/src/stack_pr/cli.py @@ -636,7 +636,7 @@ def set_head_branches( ) -> None: """Set the head ref for each stack entry if it doesn't already have one.""" - run_shell_command(["git", "fetch", "--prune", remote], quiet=not verbose) + run_shell_command(["git", "fetch", "--prune", remote, f"+refs/heads/*:refs/remotes/{remote}/*"], quiet=not verbose) available_name = get_available_branch_name(remote, branch_name_template) for e in filter(lambda e: not e.has_head(), st): e.head = available_name