Skip to content

Commit 528d5c0

Browse files
JihaoXinclaude
andcommitted
Fix release worktree not advancing due to submodule conflicts
git checkout in the prod worktree could silently fail when submodule dirs or untracked files blocked the switch. Use -f flag and clean up leftover files after checkout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6ce50a6 commit 528d5c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ark/cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3294,13 +3294,20 @@ def _cmd_webapp_release(args):
32943294
return
32953295
else:
32963296
print(f" Updating prod worktree to {_c(tag, Colors.BOLD)}...")
3297+
# Use checkout -f to handle submodule/untracked file conflicts
3298+
# that can silently prevent the worktree from advancing.
32973299
r = _sp.run(
3298-
["git", "checkout", tag],
3300+
["git", "checkout", "-f", tag],
32993301
capture_output=True, text=True, cwd=prod_dir,
33003302
)
33013303
if r.returncode != 0:
33023304
print(f" {_c(f'Error: {r.stderr.strip()}', Colors.RED)}")
33033305
return
3306+
# Clean leftover untracked files from previous releases
3307+
_sp.run(
3308+
["git", "clean", "-fd"],
3309+
capture_output=True, text=True, cwd=prod_dir,
3310+
)
33043311

33053312
print(f" {_c('Prod worktree:', Colors.GREEN)} {prod_dir}{tag}")
33063313

0 commit comments

Comments
 (0)