Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-17195] avoid whitespace in tag name
(enforced by JGit)
  • Loading branch information
ndeloof committed Mar 14, 2013
1 parent 0048cc5 commit b0a6db0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/hudson/plugins/git/GitTagAction.java
Expand Up @@ -10,6 +10,7 @@
import hudson.security.Permission;
import hudson.util.CopyOnWriteMap;
import hudson.util.MultipartFormDataParser;
import jenkins.model.*;
import org.jenkinsci.plugins.gitclient.Git;
import org.jenkinsci.plugins.gitclient.GitClient;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -47,7 +48,7 @@ protected GitTagAction(AbstractBuild build, BuildData buildData) {
}

public Descriptor<GitTagAction> getDescriptor() {
return Hudson.getInstance().getDescriptorOrDie(getClass());
return Jenkins.getInstance().getDescriptorOrDie(getClass());
}

@Override
Expand Down Expand Up @@ -187,8 +188,10 @@ public Object[] invoke(File localWorkspace, VirtualChannel channel)
.in(localWorkspace)
.getClient();

String buildNum = "hudson-" + build.getProject().getName() + "-" + tagSet.get(b);
git.tag(tagSet.get(b), "Hudson Build #" + buildNum);
String buildNum = "jenkins-"
+ build.getProject().getName().replace(" ", "_")
+ "-" + tagSet.get(b);
git.tag(tagSet.get(b), "Jenkins Build #" + buildNum);
return new Object[]{null, build};
}
});
Expand Down Expand Up @@ -222,4 +225,4 @@ public String getDisplayName() {
return "Tag";
}
}
}
}

0 comments on commit b0a6db0

Please sign in to comment.