author | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Jul 2011 22:14:43 +0000 (15:14 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Jul 2011 22:15:02 +0000 (15:15 -0700) | ||
commit | c5bcf1f9f6d3429ab9a09e07e28362e7d189005b | |
tree | 950431539a344a0fd912b4c212f3628676a0e44d | tree | snapshot |
parent | 782c2d65c24066a5d83453efb52763bc34c10f81 | commit | diff |
checkout: do not write bogus reflog entry out
As resolve_ref() returns a static buffer that is local to the function,
the caller needs to be sure that it will not have any other calls to the
function before it uses the returned value, or store it away with a
strdup(). The code used old.path to record which branch it used to be on,
so that it can say between which branches the switch took place in the
reflog, but sometimes it failed to do so.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
As resolve_ref() returns a static buffer that is local to the function,
the caller needs to be sure that it will not have any other calls to the
function before it uses the returned value, or store it away with a
strdup(). The code used old.path to record which branch it used to be on,
so that it can say between which branches the switch took place in the
reflog, but sometimes it failed to do so.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-checkout.c | diff | blob | history |