mirror of
https://github.com/git/git.git
synced 2026-08-09 17:40:16 +00:00
Merge branch 'af/clone-revision-segfault-fix' into jch
'git clone --revision=' segfaulted when the remote server advertised more refs than requested (e.g. ignoring ref prefixes), due to a NULL pointer dereference. This has been corrected. * af/clone-revision-segfault-fix: builtin/clone: fix segfault when using --revision on some servers
This commit is contained in:
@@ -557,7 +557,7 @@ static void update_remote_refs(const struct ref *refs,
|
||||
write_followtags(refs, msg);
|
||||
}
|
||||
|
||||
if (remote_head_points_at && !option_bare) {
|
||||
if (remote_head_points_at && remote_head_points_at->peer_ref && !option_bare) {
|
||||
struct strbuf head_ref = STRBUF_INIT;
|
||||
strbuf_addstr(&head_ref, branch_top);
|
||||
strbuf_addstr(&head_ref, "HEAD");
|
||||
|
||||
Reference in New Issue
Block a user