RepoCommand: Avoid group lists shadowing groups strings
Reported-by: David Pursehouse <david.pursehouse@gmail.com> Change-Id: I9e9b021d335bda4d58b6bcc30f59b81ac5b37724 Signed-off-by: Jonathan Nieder <jrn@google.com>
This commit is contained in:
parent
300787b8cf
commit
a9b87de970
|
@ -107,7 +107,7 @@
|
||||||
public class RepoCommand extends GitCommand<RevCommit> {
|
public class RepoCommand extends GitCommand<RevCommit> {
|
||||||
private String path;
|
private String path;
|
||||||
private String uri;
|
private String uri;
|
||||||
private String groups;
|
private String groupsParam;
|
||||||
private String branch;
|
private String branch;
|
||||||
private String targetBranch = Constants.HEAD;
|
private String targetBranch = Constants.HEAD;
|
||||||
private boolean recordRemoteBranch = false;
|
private boolean recordRemoteBranch = false;
|
||||||
|
@ -286,7 +286,7 @@ public RepoCommand setURI(String uri) {
|
||||||
* @return this command
|
* @return this command
|
||||||
*/
|
*/
|
||||||
public RepoCommand setGroups(String groups) {
|
public RepoCommand setGroups(String groups) {
|
||||||
this.groups = groups;
|
this.groupsParam = groups;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,7 +478,7 @@ public RevCommit call() throws GitAPIException {
|
||||||
git = new Git(repo);
|
git = new Git(repo);
|
||||||
|
|
||||||
ManifestParser parser = new ManifestParser(
|
ManifestParser parser = new ManifestParser(
|
||||||
includedReader, path, branch, uri, groups, repo);
|
includedReader, path, branch, uri, groupsParam, repo);
|
||||||
try {
|
try {
|
||||||
parser.read(inputStream);
|
parser.read(inputStream);
|
||||||
for (RepoProject proj : parser.getFilteredProjects()) {
|
for (RepoProject proj : parser.getFilteredProjects()) {
|
||||||
|
|
|
@ -167,14 +167,14 @@ public RepoProject(String name, String path, String revision,
|
||||||
* a SHA-1 or branch name or tag name
|
* a SHA-1 or branch name or tag name
|
||||||
* @param remote
|
* @param remote
|
||||||
* name of the remote definition
|
* name of the remote definition
|
||||||
* @param groups
|
* @param groupsParam
|
||||||
* comma separated group list
|
* comma separated group list
|
||||||
*/
|
*/
|
||||||
public RepoProject(String name, String path, String revision,
|
public RepoProject(String name, String path, String revision,
|
||||||
String remote, String groups) {
|
String remote, String groupsParam) {
|
||||||
this(name, path, revision, remote, new HashSet<String>(), null);
|
this(name, path, revision, remote, new HashSet<String>(), null);
|
||||||
if (groups != null && groups.length() > 0)
|
if (groupsParam != null && groupsParam.length() > 0)
|
||||||
this.setGroups(groups);
|
this.setGroups(groupsParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,14 +191,14 @@ public RepoProject setUrl(String url) {
|
||||||
/**
|
/**
|
||||||
* Set the url of the sub repo.
|
* Set the url of the sub repo.
|
||||||
*
|
*
|
||||||
* @param groups
|
* @param groupsParam
|
||||||
* comma separated group list
|
* comma separated group list
|
||||||
* @return this for chaining.
|
* @return this for chaining.
|
||||||
* @since 4.4
|
* @since 4.4
|
||||||
*/
|
*/
|
||||||
public RepoProject setGroups(String groups) {
|
public RepoProject setGroups(String groupsParam) {
|
||||||
this.groups.clear();
|
this.groups.clear();
|
||||||
this.groups.addAll(Arrays.asList(groups.split(","))); //$NON-NLS-1$
|
this.groups.addAll(Arrays.asList(groupsParam.split(","))); //$NON-NLS-1$
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue