diff options
author | Erik Faye-Lund <kusmabite@gmail.com> | 2012-05-08 19:22:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-08 10:36:55 -0700 |
commit | 8338f771fe9720766dfcb25b6dca58832e24a0fd (patch) | |
tree | 6bb1594c45fffde796364ee577ff34cf548fee17 /t/t1400-update-ref.sh | |
parent | git checkout -b: allow switching out of an unborn branch (diff) | |
download | tgif-8338f771fe9720766dfcb25b6dca58832e24a0fd.tar.xz |
checkout: do not corrupt HEAD on empty repo
In abe1998 ("git checkout -b: allow switching out of an unborn
branch"), a code-path overly-optimisticly assumed that a
branch-name was specified. This is not always the case, and as
a result a NULL-pointer was attempted printed to .git/HEAD.
This could lead to at least two different failure modes:
1) vsnprintf formated the NULL-string as something useful (e.g
"(null)")
2) vsnprintf crashed
Neither were very convenient for formatting a new HEAD-reference.
To fix this, reintroduce some strictness so we only take this
new codepath if a banch-name was specified.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1400-update-ref.sh')
0 files changed, 0 insertions, 0 deletions