Git clone task Config sections override [message #1775579] |
Wed, 01 November 2017 13:19  |
Eclipse User |
|
|
|
Hi. I have a Git clone task with a "Config Sections" child to set the default configuration of the master branch as follows:
<configSections
name="branch "master"">
<properties
key="rebase"
value="preserve"/>
</configSections>
However this results in creating a new section, rather than overriding the default configuration property. More precisely the resulting .git/config file contains the following:
[branch "master"]
rebase = preserve
[branch "master"]
remote = origin
merge = refs/heads/master
rebase = true
instead of just
[branch "master"]
remote = origin
merge = refs/heads/master
rebase = preserve
Is there a way to override git config properties?
Thanks
|
|
|
Re: Git clone task Config sections override [message #1775617 is a reply to message #1775579] |
Thu, 02 November 2017 05:13  |
Eclipse User |
|
|
|
I expect the processing in org.eclipse.oomph.setup.git.impl.GitCloneTaskImpl.configureRepository(SetupTaskContext, Repository, String, boolean, String, String, String, List<? extends ConfigSection>) which does this: if (value.isEmpty())
{
config.unset(sectionName, subsectionName, key);
changed |= oldValue.length != 0;
}
else
{
config.setStringList(sectionName, subsectionName, key, value);
changed |= !Arrays.asList(oldValue).equals(value);
} to do what the method names suggest, i.e., unset the value or set the value, not to add a new value that duplicates. I suspect the structure you have is inappropriate, i.e., I suspect the section name should be "branch", with a subsection named "master", with properties nested in that subsection.
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds