mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 03:15:46 +00:00
Set new multivar values using unmatcheable regexp.
Seems that regexp in Mac OS X and Linux were behaving differently: while in OS X the empty string didn't match any value, in Linux it was matching all of them, so the the second fetch refspec was overwritting the first one, instead of creating a new one. Using an unmatcheable regular expression solves the problem (and seems to be portable).
This commit is contained in:
parent
a71331ebc4
commit
376454d03d
@ -387,8 +387,11 @@ static int update_config_refspec(const git_remote *remote, git_config *config, i
|
|||||||
if (spec->push != push)
|
if (spec->push != push)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// "$^" is a unmatcheable regexp: it will not match anything at all, so
|
||||||
|
// all values will be considered new and we will not replace any
|
||||||
|
// present value.
|
||||||
if ((error = git_config_set_multivar(
|
if ((error = git_config_set_multivar(
|
||||||
config, cname, "", spec->string)) < 0) {
|
config, cname, "$^", spec->string)) < 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user