mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 07:20:07 +00:00
remote: don't try to update FETCH_HEAD if no extra heads exist
Don't try to update anything if there are no heads to update. This saves us from trying to look into a fetch refspec when there is none. A better fix for compatibility with git when using remotes without refspecs is still needed, but this stops us from segfaulting.
This commit is contained in:
parent
67ba7d2031
commit
404eadb089
@ -731,6 +731,10 @@ static int git_remote_write_fetchhead(git_remote *remote, git_vector *update_hea
|
||||
|
||||
assert(remote);
|
||||
|
||||
/* no heads, nothing to do */
|
||||
if (update_heads->length == 0)
|
||||
return 0;
|
||||
|
||||
spec = &remote->fetch;
|
||||
|
||||
if (git_vector_init(&fetchhead_refs, update_heads->length, git_fetchhead_ref_cmp) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user