From: Nguyễn Thái Ngọc Duy Date: Tue, 29 Jul 2014 13:50:25 GMT Subject: [PATCH v2 2/8] checkout: no need to call check_linked_checkouts if head_ref is NULL Message-ID: <1406641831-2390-3-git-send-email-pclouds@gmail.com> In-Reply-To: <1406641831-2390-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index c83f476..6ac89eb 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1202,7 +1202,8 @@ static int parse_branchname_arg(int argc, const char **argv, unsigned char sha1[20]; int flag; char *head_ref = resolve_refdup("HEAD", sha1, 0, &flag); - if (!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path)) + if (head_ref && + (!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path))) check_linked_checkouts(new); free(head_ref); } -- 2.1.0.rc0.78.gc0d8480