Skip to content

BUG: parse_git_status crashes with ValueError when branch name contains "..." #1371

Description

@devteamaegis

When git reports a branch whose name itself contains the substring ... (e.g. feat...v2) with a tracking upstream, the porcelain output looks like ## feat...v2...origin/feat...v2. The line branch, upstream_branch = normalized_branch.split("...") in packages/python-sdk/e2b/sandbox/_git/parse.py splits on every occurrence of ..., producing more than two parts, and the two-variable unpacking immediately raises ValueError: too many values to unpack (expected 2).

Traceback:

  File "parse.py", line 135, in parse_git_status
    branch, upstream_branch = normalized_branch.split("...")
ValueError: too many values to unpack (expected 2)

To reproduce, run: python3 -c "from e2b.sandbox._git.parse import parse_git_status; parse_git_status('## feat...v2...origin/feat...v2\n')"

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions