summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-06 01:13:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-06 01:28:03 (GMT)
commitc2d17ba3db0d2b14daf04e69a8c5ec73b023c1fe (patch)
tree712bb237748c8e19efd11a653f10f5c82df0c46f /builtin/commit.c
parent840c519d7e7ae4651a7b5a0954f7aa53eebc29b6 (diff)
downloadgit-c2d17ba3db0d2b14daf04e69a8c5ec73b023c1fe.zip
git-c2d17ba3db0d2b14daf04e69a8c5ec73b023c1fe.tar.gz
git-c2d17ba3db0d2b14daf04e69a8c5ec73b023c1fe.tar.bz2
branch --edit-description: protect against mistyped branch name
It is very easy to mistype the branch name when editing its description, e.g. $ git checkout -b my-topic master : work work work : now we are at a good point to switch working something else $ git checkout master : ah, let's write it down before we forget what we were doing $ git branch --edit-description my-tpoic The command does not notice that branch 'my-tpoic' does not exist. It is not lost (it becomes description of an unborn my-tpoic branch), but is not very useful. So detect such a case and error out to reduce the grief factor from this common mistake. This incidentally also errors out --edit-description when the HEAD points at an unborn branch (immediately after "init", or "checkout --orphan"), because at that point, you do not even have any commit that is part of your history and there is no point in describing how this particular branch is different from the branch it forked off of, which is the useful bit of information the branch description is designed to capture. We may want to special case the unborn case later, but that is outside the scope of this patch to prevent more common mistakes before 1.7.9 series gains too much widespread use. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions