Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Revert "Merge pull request #187 from jenkinsci/JENKINS-14026"
- Loading branch information
|
@@ -435,10 +435,6 @@ private String getSingleBranch(EnvVars env) { |
|
|
// Check for empty string - replace with "**" when seen. |
|
|
if (branch.equals("")) { |
|
|
branch = "**"; |
|
|
} else if (!branch.startsWith(repository)) { |
|
|
// we can hit this case if the given branch name contains a slash. |
|
|
// Since we have a single repository, it makes sense to prepend it anyway |
|
|
branch = repository + "/" + branch; |
|
|
} |
|
|
|
|
|
return branch; |
|
|
|
@@ -494,20 +494,6 @@ public void testBranchIsAvailableInEvironment() throws Exception { |
|
|
assertEquals("origin/master", getEnvVars(project).get(GitSCM.GIT_BRANCH)); |
|
|
} |
|
|
|
|
|
public void testBranchContainsSlash() throws Exception { |
|
|
FreeStyleProject project = setupSimpleProject("my/branch"); |
|
|
|
|
|
final String commitFile1 = "commitFile1"; |
|
|
commit(commitFile1, johnDoe, "Commit number 1"); |
|
|
git.branch("my/branch"); |
|
|
git.checkout("my/branch"); |
|
|
final String commitFile2 = "commitFile2"; |
|
|
commit(commitFile2, johnDoe, "Commit number 2"); |
|
|
build(project, Result.SUCCESS, commitFile1, commitFile2); |
|
|
|
|
|
assertEquals("origin/my/branch", getEnvVars(project).get(GitSCM.GIT_BRANCH)); |
|
|
} |
|
|
|
|
|
// For HUDSON-7411 |
|
|
public void testNodeEnvVarsAvailable() throws Exception { |
|
|
FreeStyleProject project = setupSimpleProject("master"); |
|
|