Skip to content

fix: normalize relative paths to remove leading ./ before passing to git2 - #132

Merged
miguelramos merged 1 commit into
mainfrom
fix/CHANGESET-RELATIVE-PATHS
Jan 14, 2026
Merged

fix: normalize relative paths to remove leading ./ before passing to git2#132
miguelramos merged 1 commit into
mainfrom
fix/CHANGESET-RELATIVE-PATHS

Conversation

@miguelramos

Copy link
Copy Markdown
Member

git2's index operations (add_path, remove_path) fail with error 'should not start with .'' when given paths starting with './'. This occurred during bump --execute with changeset archiving when the workspace root was '.'.

The fix normalizes relative paths in three locations:

  • cli/commands/bump/git_integration.rs: strip ./ from relative paths before staging files for commit
  • git/repo.rs: strip ./ in add() and remove() methods as defense in depth

Added comprehensive unit tests for path normalization in both crates.

…git2

git2's index operations (add_path, remove_path) fail with error 'should not
start with `.'`' when given paths starting with './'. This occurred during
bump --execute with changeset archiving when the workspace root was '.'.

The fix normalizes relative paths in three locations:
- cli/commands/bump/git_integration.rs: strip ./ from relative paths before
  staging files for commit
- git/repo.rs: strip ./ in add() and remove() methods as defense in depth

Added comprehensive unit tests for path normalization in both crates.
@miguelramos miguelramos self-assigned this Jan 14, 2026
@miguelramos
miguelramos merged commit b8504e4 into main Jan 14, 2026
10 checks passed
@miguelramos
miguelramos deleted the fix/CHANGESET-RELATIVE-PATHS branch January 14, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 TYPE: Bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant