Package org.eclipse.jgit.revwalk

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


      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

      throw new UnmergedPathsException(e);
    } catch (IOException e) {
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfCommitCommand, e);
    } finally {
      rw.dispose();
    }
  }

  private void insertChangeId(ObjectId treeId) throws IOException {
    ObjectId firstParentId = null;
View Full Code Here

    try {
      tw = TreeWalk.forPath(db, path, rw.parseTree(headId));
      return tw != null;
    } finally {
      rw.release();
      rw.dispose();
      if (tw != null)
        tw.release();
    }
  }
View Full Code Here

          throw new JGitInternalException(MessageFormat.format(
              JGitText.get().cannotReadCommit, entry.getNewId()),
              e);
        }
    } finally {
      walk.dispose();
    }
    return stashCommits;
  }
}
View Full Code Here

      return true;
    } catch (Exception e) {
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
          "An error occured when tagging.", e));
    } finally {
      walk.dispose();
    }
  }

  static Ref tag(Git git, RevCommit revCommit, String tagName) throws GitAPIException {
    TagCommand tag = git.tag();
View Full Code Here

          aheadCount = RevWalkUtils.count(walk, toRevCommit, next);
          behindCount = RevWalkUtils.count(walk, fromRevCommit, next);
          toObjectId = next.toObjectId();
          fromObjectId = null;
        } finally {
          walk.dispose();
        }
      }

      logCommand = new LogCommand(db);
      if (refIdsRange != null) {
View Full Code Here

        } else if (any instanceof RevCommit) {
          this.commit = (RevCommit) any;
        }
      } catch (IOException e) {
      } finally {
        rw.dispose();
      }
    }
    return commit;
  }
View Full Code Here

      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
    }
    RevWalk walk = new RevWalk(db);
    walk.setTreeFilter(AndTreeFilter.create(PathFilterGroup.createFromStrings(Collections.singleton(pattern)), TreeFilter.ANY_DIFF));
    RevCommit revCommit = walk.parseCommit(refId);
    walk.dispose();

    Commit commit = new Commit(null /* not needed */, db, revCommit, pattern);
    ObjectStream stream = commit.toObjectStream();
    if (stream == null) {
      String msg = NLS.bind("Commit body for ref {0} not found", ref);
View Full Code Here

          "An error occured when tagging.", e));
    } catch (CoreException e) {
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
          "An error occured when tagging.", e));
    } finally {
      walk.dispose();
    }
  }
}
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.