mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
builtin-fetch: Don't segfault on "fetch +foo"
If we are fetching something and were configured to do a forced fetch and have no local ref to store the fetched object into we cannot mark the local ref as having a forced update. Instead we should just silently discard the + request. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
f38395905b
commit
27e13374bf
3
remote.c
3
remote.c
@ -875,8 +875,7 @@ int get_fetch_map(struct ref *remote_refs,
|
|||||||
refspec->src : "HEAD");
|
refspec->src : "HEAD");
|
||||||
|
|
||||||
ref_map->peer_ref = get_local_ref(refspec->dst);
|
ref_map->peer_ref = get_local_ref(refspec->dst);
|
||||||
|
if (ref_map->peer_ref && refspec->force)
|
||||||
if (refspec->force)
|
|
||||||
ref_map->peer_ref->force = 1;
|
ref_map->peer_ref->force = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user