Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-9253] Added GIT_COMMIT environment variable available …
…during build.
  • Loading branch information
abayer committed Apr 5, 2011
1 parent e603bb0 commit 58a2cb3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -1135,6 +1135,14 @@ public void buildEnvVars(AbstractBuild<?,?> build, java.util.Map<String, String>
if(branch != null){
env.put(GIT_BRANCH, branch);
}
BuildData bd = fixNull(getBuildData(build, false));
if (bd != null) {
String commit = bd.getLastBuiltRevision().getSha1String();
if (commit != null) {
env.put(GIT_COMMIT, commit);
}
}

}

private String putChangelogDiffsIntoFile(IGitAPI git, String branchName, String revFrom,
Expand Down

0 comments on commit 58a2cb3

Please sign in to comment.