Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kgyrtkirk/hive-toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Feb 10, 2022
2 parents b907885 + df64f98 commit 0f34c91
Show file tree
Hide file tree
Showing 3 changed files with 396 additions and 46 deletions.
37 changes: 0 additions & 37 deletions src/main/groovy/adjust_patch.groovy

This file was deleted.

15 changes: 6 additions & 9 deletions src/main/java/hu/rxd/toolbox/TicketUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -18,16 +17,13 @@
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.revwalk.filter.RevFilter;
import org.eclipse.jgit.treewalk.AbstractTreeIterator;
import org.eclipse.jgit.treewalk.CanonicalTreeParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Joiner;

import hu.rxd.toolbox.jira.HiveTicket;
import hu.rxd.toolbox.jira.ToolboxSettings;
import hu.rxd.toolbox.qtest.diff.CachedURL;
Expand Down Expand Up @@ -79,8 +75,8 @@ public static void upload() throws Exception {
File patchFile = new File(patchFileName);

ObjectId ref = repo.resolve("apache/master");


try (FileOutputStream fos = new FileOutputStream(patchFile)) {
git.diff().setOldTree(getMergeBase(repo, "apache/master", "HEAD"))
.setNewTree(getMergeBase(repo, "HEAD", "HEAD"))
Expand All @@ -93,7 +89,7 @@ public static void upload() throws Exception {
}
}

private static AbstractTreeIterator getMergeBase(Repository repo, String string, String string2) throws Exception {
public static AbstractTreeIterator getMergeBase(Repository repo, String string, String string2) throws Exception {
try (RevWalk walk = new RevWalk(repo)) {
RevCommit c1 = walk.parseCommit(repo.resolve(string));
RevCommit c2 = walk.parseCommit(repo.resolve(string2));
Expand All @@ -116,8 +112,9 @@ private static AbstractTreeIterator getMergeBase(Repository repo, String string,
static private AbstractTreeIterator getTreeIterator(String name, Repository repo)
throws IOException {
final ObjectId id = repo.resolve(name);
if (id == null)
if (id == null) {
throw new IllegalArgumentException(name);
}
final CanonicalTreeParser p = new CanonicalTreeParser();
try (ObjectReader or = repo.newObjectReader();
RevWalk rw = new RevWalk(repo)) {
Expand Down Expand Up @@ -161,7 +158,7 @@ public void process(String line) {
if (nofromat == 1) {
processTestLine(line);
}

}

private void processTestLine(String line) {
Expand Down
Loading

0 comments on commit 0f34c91

Please sign in to comment.