Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderv32 committed Jul 24, 2019
1 parent 9136b53 commit c860205
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/main/java/org/jenkinsci/plugins/gogs/GogsWebHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ associated documentation files (the "Software"), to deal in the Software without
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

Expand Down Expand Up @@ -149,17 +148,6 @@ public void doIndex(StaplerRequest req, StaplerResponse rsp) throws IOException
return;
}

String ref = jsonObject.getString("ref");
LOGGER.fine("found ref " + ref);
LOGGER.fine("found branch " + branchName);
if (null != branchName && !StringUtils.containsIgnoreCase(ref, (String) branchName)) {
// ignore all commit if they is not in context
LOGGER.fine("build was rejected");
result.setStatus(200, String.format("Commit is not relevant. Relevant context is %s", branchName));
exitWebHook(result, rsp);
return;
}

String contentType = req.getContentType();
if (contentType != null && contentType.startsWith("application/x-www-form-urlencoded")) {
body = URLDecoder.decode(body, DEFAULT_CHARSET);
Expand Down

0 comments on commit c860205

Please sign in to comment.