Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Rodríguez Troitiño <drodrigueztroitino@yahoo.es>2013-11-01 02:42:04 +0400
committerDaniel Rodríguez Troitiño <drodrigueztroitino@yahoo.es>2013-11-01 03:08:52 +0400
commit376454d03dbb0c78b1266a85b29ec8bf48930a4d (patch)
tree823942188ed312d74b09ce5abf632a403137bdf2 /src/remote.c
parenta71331ebc40b445a58d73a1fe3fb2dc21665c09c (diff)
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).
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/remote.c b/src/remote.c
index e2b40347a..3528b1c46 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -387,8 +387,11 @@ static int update_config_refspec(const git_remote *remote, git_config *config, i
if (spec->push != push)
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(
- config, cname, "", spec->string)) < 0) {
+ config, cname, "$^", spec->string)) < 0) {
goto cleanup;
}
}