diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2011-02-08 04:34:34 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-08 11:14:26 -0800 |
commit | f8bd36a433768f1b11642faff5b88e3510aa8af8 (patch) | |
tree | b2af33785acca45118e2004102edb8693c423c88 /read-cache.c | |
parent | checkout: introduce --detach synonym for "git checkout foo^{commit}" (diff) | |
download | tgif-f8bd36a433768f1b11642faff5b88e3510aa8af8.tar.xz |
checkout: rearrange update_refs_for_switch for clarity
Take care of simple, exceptional cases before the meat of the "check
out by branch name" code begins. After this change, the function
vaguely follows the following pseudocode:
if (-B or -b)
create branch;
if (plain "git checkout" or "git checkout HEAD")
;
else if (--detach or checking out by non-branch commit name)
detach HEAD;
else if (checking out by branch name)
attach HEAD;
One nice side benefit is to make it possible to remove handling of
the --detach option from outside switch_branches.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
0 files changed, 0 insertions, 0 deletions