Created
March 10, 2016 21:21
-
-
Save kimar/45f40fe2a912c55ba4c0 to your computer and use it in GitHub Desktop.
Fixes an issue in Git that leads to being able to delete the currently checked out branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/builtin/branch.c b/builtin/branch.c | |
index 7b45b6b..46bde61 100644 | |
--- a/builtin/branch.c | |
+++ b/builtin/branch.c | |
@@ -215,7 +215,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds, | |
int flags = 0; | |
strbuf_branchname(&bname, argv[i]); | |
- if (kinds == FILTER_REFS_BRANCHES && !strcmp(head, bname.buf)) { | |
+ if (kinds == FILTER_REFS_BRANCHES && !strcasecmp(head, bname.buf)) { | |
error(_("Cannot delete the branch '%s' " | |
"which you are currently on."), bname.buf); | |
ret = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment