Browse Source

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>
stable-4.5
Jonathan Nieder 8 years ago
parent
commit
a9b87de970
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
  2. 14
      org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java

6
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

@ -107,7 +107,7 @@ import org.eclipse.jgit.util.FileUtils;
public class RepoCommand extends GitCommand<RevCommit> {
private String path;
private String uri;
private String groups;
private String groupsParam;
private String branch;
private String targetBranch = Constants.HEAD;
private boolean recordRemoteBranch = false;
@ -286,7 +286,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
* @return this command
*/
public RepoCommand setGroups(String groups) {
this.groups = groups;
this.groupsParam = groups;
return this;
}
@ -478,7 +478,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
git = new Git(repo);
ManifestParser parser = new ManifestParser(
includedReader, path, branch, uri, groups, repo);
includedReader, path, branch, uri, groupsParam, repo);
try {
parser.read(inputStream);
for (RepoProject proj : parser.getFilteredProjects()) {

14
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java

@ -167,14 +167,14 @@ public class RepoProject implements Comparable<RepoProject> {
* a SHA-1 or branch name or tag name
* @param remote
* name of the remote definition
* @param groups
* @param groupsParam
* comma separated group list
*/
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);
if (groups != null && groups.length() > 0)
this.setGroups(groups);
if (groupsParam != null && groupsParam.length() > 0)
this.setGroups(groupsParam);
}
/**
@ -191,14 +191,14 @@ public class RepoProject implements Comparable<RepoProject> {
/**
* Set the url of the sub repo.
*
* @param groups
* @param groupsParam
* comma separated group list
* @return this for chaining.
* @since 4.4
*/
public RepoProject setGroups(String groups) {
public RepoProject setGroups(String groupsParam) {
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;
}

Loading…
Cancel
Save