Running git branch --contains returns all branches that contain current commit. There can be multiple branches like that, which results in garbage value being returned.
New implementation will return the branch that git thinks is checked out currently. It will report detached HEAD state properly.
Running
git branch --containsreturns all branches that contain current commit. There can be multiple branches like that, which results in garbage value being returned.New implementation will return the branch that git thinks is checked out currently. It will report detached HEAD state properly.