Skip to content

land should exit gracefully when there are non-submitted changes, now it crashes #107

@ZolotukhinM

Description

@ZolotukhinM

Repro:

  1. make change zzz
  2. stack-pr export
  3. make change ppp
  4. stack-pr view:
VIEW
Stack:
   * 3344c73c (no PR, 'ZolotukhinM/stack/133' -> 'ZolotukhinM/stack/132'): ppp
   * a7883442 (#139, 'ZolotukhinM/stack/132' -> 'main'): zzz
  1. stack-pr land
LAND
Traceback (most recent call last):
  File "/Users/mvz/.local/bin/stack-pr", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 1659, in main
    command_land(common_args)
    ~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 1241, in command_land
    set_base_branches(st, args.target)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 483, in set_base_branches
    e.base, prev_branch = prev_branch, e.head
                                       ^^^^^^
  File "/Users/mvz/.local/pipx/venvs/stack-pr/lib/python3.13/site-packages/stack_pr/cli.py", line 300, in head
    raise ValueError("head is not set")
ValueError: head is not set

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions