Skip to content

Commit

Permalink
Merge pull request #20 from jenkinsci/repo-check
Browse files Browse the repository at this point in the history
Only try and get commit data if workspace has a repo
  • Loading branch information
aboe026 committed Jun 6, 2019
2 parents d0f5bc1 + 8ddd3ae commit 55acd7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ protected void evaluateDRAData() {
DRAData data = cloudCause.getDRAData();

List<Action> actions = run.getActions();
if(data == null) {
if (data == null) {
data = crAction.getDRAData();
cloudCause.setDRAData(data);
}

if(data == null) {
if (data == null) {
data = new DRAData();
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/ibm/devops/connect/Status/SourceData.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public void populateCommitMessage(TaskListener listener, EnvVars envVars, FilePa
}

GitClient gitClient = git.getClient();
RevCommit commit = gitClient.withRepository(new RevCommitRepositoryCallback(gitBuild));

this.shortMessage = commit.getShortMessage();
this.fullMessage = commit.getFullMessage();
if (gitClient.hasGitRepo()) {
RevCommit commit = gitClient.withRepository(new RevCommitRepositoryCallback(gitBuild));

this.shortMessage = commit.getShortMessage();
this.fullMessage = commit.getFullMessage();
}
} catch (IOException ioEx) {
log.warn("IOException thrown while trying to retrieve commit message in populateCommitMessage: " + ioEx);
} catch (InterruptedException intEx) {
Expand Down

0 comments on commit 55acd7c

Please sign in to comment.