Skip to content
Permalink
Browse files
[FIXED JENKINS-17195] avoid whitespace in tag name
(enforced by JGit)
  • Loading branch information
ndeloof committed Mar 14, 2013
1 parent 0048cc5 commit b0a6db04e3afa05ec054757e076090e51be91755
Showing 1 changed file with 7 additions and 4 deletions.
@@ -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;
@@ -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
@@ -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};
}
});
@@ -222,4 +225,4 @@ public String getDisplayName() {
return "Tag";
}
}
}
}

0 comments on commit b0a6db0

Please sign in to comment.