diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2014-07-29 20:50:25 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-29 13:42:12 -0700 |
commit | 4f25b3169d44c9bc72cf173dc207d37649c16277 (patch) | |
tree | 69f83d7a84c1695a9ab3a32c400d03632f3cf830 | |
parent | a0a26b8439aaf7f533817d7e9cc2a66be5e1e2a7 (diff) | |
download | git-4f25b3169d44c9bc72cf173dc207d37649c16277.tar.gz |
checkout: no need to call check_linked_checkouts if head_ref is NULL
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin/checkout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index c83f476a36..6ac89eb365 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); } |