Skip to content

Commit

Permalink
Address more review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ascandella committed Aug 10, 2015
1 parent dbe92a0 commit bf661b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private String getPhabricatorURL(Job owner) {
if (credentials != null) {
return credentials.getUrl();
}
return this.getDescriptor().getConduitURL();
return getDescriptor().getConduitURL();
}

private String getConduitToken(Job owner, Logger logger) {
Expand All @@ -193,15 +193,15 @@ private String getConduitToken(Job owner, Logger logger) {
return credentials.getToken().getPlainText();
}
logger.warn("credentials", "No credentials configured. Falling back to deprecated configuration.");
return this.getDescriptor().getConduitToken();
return getDescriptor().getConduitToken();
}

/**
* Return the path to the arcanist executable
* @return a string, fully-qualified or not, could just be "arc"
*/
private String getArcPath() {
final String providedPath = this.getDescriptor().getArcPath();
final String providedPath = getDescriptor().getArcPath();
if (CommonUtils.isBlank(providedPath)) {
return "arc";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ protected void setup() {
@Override
protected void execute() {
try {
int resetCode = starter.launch()
int exitCode = starter.launch()
.cmds(Arrays.asList(gitPath, "reset", "--hard", baseCommit))
.stdout(logStream)
.join();

if (resetCode != 0) {
info("Got non-zero exit code resetting to base commit " + baseCommit + ": " + resetCode);
if (exitCode != 0) {
info("Got non-zero exit code resetting to base commit " + baseCommit + ": " + exitCode);
}

// Clean workspace, otherwise `arc patch` may fail
Expand All @@ -98,23 +98,19 @@ protected void execute() {
.cmds(Arrays.asList(gitPath, "submodule", "update", "--init", "--recursive"))
.join();

List<String> params = new ArrayList<String>(Arrays.asList("--nobranch", "--diff", diffID));
List<String> arcPatchParams = new ArrayList<String>(Arrays.asList("--nobranch", "--diff", diffID));
if (!createCommit) {
params.add("--nocommit");
arcPatchParams.add("--nocommit");
}

ArcanistClient arc = new ArcanistClient(
arcPath,
"patch",
conduitToken,
params.toArray(new String[params.size()]));
arcPatchParams.toArray(new String[arcPatchParams.size()]));

int result = arc.callConduit(starter.launch(), logStream);
if (result == 0) {
this.result = Result.SUCCESS;
} else {
this.result = Result.FAILURE;
}
exitCode = arc.callConduit(starter.launch(), logStream);
this.result = exitCode == 0 ? Result.SUCCESS : Result.FAILURE;
} catch (IOException e) {
e.printStackTrace(logStream);
this.result = Result.FAILURE;
Expand Down

0 comments on commit bf661b8

Please sign in to comment.