Commit a242d43d by Edward Thomson

remote: don't update invalid refs

If a symbolic reference points to something invalid, then do not try to
update it.
parent d81a85c5
......@@ -1133,6 +1133,16 @@ static int remote_head_for_ref(git_remote_head **out, git_remote *remote, git_re
ref_name = git_reference_name(resolved_ref);
}
/*
* The ref name may be unresolvable - perhaps it's pointing to
* something invalid. In this case, there is no remote head for
* this ref.
*/
if (!ref_name) {
error = 0;
goto cleanup;
}
if ((error = ref_to_update(&update, &remote_name, remote, spec, ref_name)) < 0)
goto cleanup;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment