Package org.eclipse.jgit.revwalk

Examples of org.eclipse.jgit.revwalk.RevWalk.dispose()


      treeParser.reset(newObjectReader, gitTree.getId());
    }
    finally {
      newObjectReader.release();
    }
    revWalk.dispose();
    return treeParser;
  }

  private static Repository openGitRepository() throws IOException {
View Full Code Here


      treeWalk.addTree(new DirCacheIterator(repo.readDirCache()));
      ObjectId headID = repo.resolve(Constants.HEAD);
      if (headID != null) {
        revWalk = new RevWalk(repo);
        treeWalk.addTree(revWalk.parseTree(headID));
        revWalk.dispose();
        revWalk = null;
      }

      treeWalk.setFilter(TreeFilter.ANY_DIFF);
      treeWalk.setRecursive(true);
View Full Code Here

          }
        }
      return ret;
    } finally {
      if (revWalk != null)
        revWalk.dispose();
      treeWalk.release();
    }
  }

  private PackFile writePack(Set<? extends ObjectId> want,
View Full Code Here

        List<GitBranch> branches = new ArrayList<>();

        for(Ref branchRef : new Git(repository).branchList().call()) {
            RevWalk walk = new RevWalk(repository);
            RevCommit head = walk.parseCommit(branchRef.getObjectId());
            walk.dispose();

            GitBranch newBranch = new GitBranch(branchRef.getName(), new GitCommit(head));
            setTheLatestPullRequest(newBranch);

            branches.add(newBranch);
View Full Code Here

            walk.markUninteresting(walk.parseCommit(to));

            return IteratorUtils.toList(walk.iterator());
        } finally {
            if (walk != null) {
                walk.dispose();
            }
        }
    }

    public static List<GitCommit> diffCommits(Repository repository, String fromBranch, String toBranch) throws IOException {
View Full Code Here

                    authors.add(getAuthorFromFirstCommit(repository, diff.getOldPath(), commitA));
                }
            }
        } finally {
            if (revWalk != null) {
                revWalk.dispose();
            }
        }

        authors.remove(User.anonymous);
        return authors;
View Full Code Here

                return User.anonymous;
            }
            return findAuthorByPersonIdent(commit.getAuthorIdent());
        } finally {
            if (revWalk != null) {
                revWalk.dispose();
            }
        }
    }

    /**
 
View Full Code Here

            return out.toString("UTF-8");
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            walk.dispose();
        }
    }

    public static String getPatch(PullRequest pullRequest) {
        if(pullRequest.mergedCommitIdFrom == null || pullRequest.mergedCommitIdTo == null) {
View Full Code Here

            String headBranchName = getDefaultBranch();

            ObjectId branchObjectId = repository.resolve(headBranchName);
            RevWalk walk = new RevWalk(repository);
            RevCommit head = walk.parseCommit(branchObjectId);
            walk.dispose();

            return new GitBranch(headBranchName, new GitCommit(head));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

            RevWalk rw = new RevWalk(repository);
            rw.markStart(rw.parseCommit(endRange));
            if (startRange.equals(ObjectId.zeroId())) {
                // maybe this is a tag or an orphan branch
                list.add(rw.parseCommit(endRange));
                rw.dispose();
                return list;
            } else {
                rw.markUninteresting(rw.parseCommit(startRange));
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.