git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: git branch -D can be used to delete branch which is currently checked out
@ 2016-03-10  8:20 Marcus Kida
  2016-03-10 17:40 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Kida @ 2016-03-10  8:20 UTC (permalink / raw)
  To: git

Testes on: 

Mac OS X 10.11.3 (El Capitan) using Git 2.6.4

Issue:

git branch -D can be used to delete branch which is currently checked out

Steps to reproduce:

inside a git repository:

$ git checkout -b feature/myAwesomeFeature

-> you end up in feature/myAwesomeFeature branch

$ git checkout FEATURE/myAwesomeFeature

-> you end up in FEATURE/myAwesomeFeature branch

$ git branch -D feature/myAwesomeFeature branch

-> BOOM you just deleted the branch you were at. Congrats you repo is dirty again.

Actual behaviour:

It seems like checking out / deleting branches is case insensitive thus you can delete a branch you are on by just using a different capitalisation when specifying the branch to delete.

Expected behaviour:

error: Cannot delete the branch 'FEATURE/myAwesomeFeature' which you are currently on.

Thank you, please don't hesitate to contact me in case you need more info or if this has already been fixed in the meantime.

Cheers,
Marcus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-10 18:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10  8:20 Bug: git branch -D can be used to delete branch which is currently checked out Marcus Kida
2016-03-10 17:40 ` Junio C Hamano
2016-03-10 18:23   ` Junio C Hamano
2016-03-10 18:38     ` Marcus Kida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).