Code

merge: use return value of resolve_ref() to determine if HEAD is invalid
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 17 Sep 2011 11:57:43 +0000 (21:57 +1000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Sep 2011 20:55:56 +0000 (13:55 -0700)
commit10b98fa5b3fab4a4ba46f31b58f8da703b465b68
treec0e1b8e9d884faa2a43b05ece0f688b9bc66532f
parentb4fd94064de5cec7a45883684225b600d36208d9
merge: use return value of resolve_ref() to determine if HEAD is invalid

resolve_ref() only updates "head" when it returns non NULL value (it
may update "head" even when returning NULL, but not in all cases).

Because "head" is not initialized before the call, is_null_sha1() is
not enough. Check also resolve_ref() return value.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c