diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-05 17:13:36 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-05 17:28:03 -0800 |
commit | c2d17ba3db0d2b14daf04e69a8c5ec73b023c1fe (patch) | |
tree | 712bb237748c8e19efd11a653f10f5c82df0c46f /t/t9145-git-svn-master-branch.sh | |
parent | tests: add write_script helper function (diff) | |
download | tgif-c2d17ba3db0d2b14daf04e69a8c5ec73b023c1fe.tar.xz |
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 't/t9145-git-svn-master-branch.sh')
0 files changed, 0 insertions, 0 deletions