aboutsummaryrefslogtreecommitdiff
path: root/t/t2011-checkout-invalid-head.sh
Commit message (Collapse)AuthorAge
* test: use $_z40 from test-libJunio C Hamano2011-04-23
| | | | | | | There is no need to duplicate the definition of $_z40 and $_x40 that test-lib.sh supplies the test scripts. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git checkout: do not allow switching to a tree-ish that is not a commitJunio C Hamano2009-01-03
| | | | | | | | | | | | | | "git checkout -b newbranch $commit^{tree}" mistakenly created a new branch rooted at the current HEAD, because in that case, the two structure fields used to see if the command was invoked without any argument (hence it needs to default to checking out the HEAD) were populated incorrectly. Upon seeing a command line argument that we took as a rev, we should store that string in new.name, even if that does not name a commit. This will correctly trigger the existing safety logic. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Daniel Barkalow <barkalow@iabervon.org>
* checkout: Don't crash when switching away from an invalid branch.Alexandre Julliard2008-11-09
When using alternates, it is possible for HEAD to end up pointing to an invalid commit. git checkout should be able to recover from that situation without crashing. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>