arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git
Apache License 2.0
3.43k stars 84 forks source link

Bad interaction between `reset`/`checkout` and branch names that are ambiguous with file paths #1153

Open arxanas opened 9 months ago

arxanas commented 9 months ago

Description of the bug

Had an issue something like this:

$ mkdir -p foo/bar
$ touch foo/bar/baz
$ git add foo/bar/baz
$ git checkout -b foo/bar
$ git amend

Expected behavior

Amends normally; staging area is clean afterwards.

Actual behavior

Some warning was printed due to the implicit use of git reset, and then the staging area was not clean as expected.

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

git-branchless-opts 0.8.0

Version of git

2.42.0