[PATCH] Prevent force updating of the current branch
- From
Conrad Irwin <conrad.irwin@gmail.com>
- Date
- Aug 20, 2011, 21:49 UTC
- Message-ID
- <1313876989-16328-1-git-send-email-conrad.irwin@gmail.com>
I noticed when trying to improve the user-experience of creating ambiguous branches [1] that there are insufficient checks to safeguard git-branch -M and git-checkout -B from over-writing the current branch.
Conrad
[1] http://thread.gmane.org/gmane.comp.version-control.git/179503
--- branch.c | 34 ++++++++++++++++++++++++---------- branch.h | 8 ++++++++ builtin/branch.c | 6 +----- builtin/checkout.c | 12 +++--------- t/t2018-checkout-branch.sh | 17 +++++++++++++++++ t/t3200-branch.sh | 12 ++++++++++++ 6 files changed, 65 insertions(+), 24 deletions(-)