Java Code Examples for org.eclipse.jgit.lib.ObjectId#copy()

The following examples show how to use org.eclipse.jgit.lib.ObjectId#copy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskKey.java    From git-lfs-migrate with MIT License 5 votes vote down vote up
public TaskKey(@NotNull GitConverter.TaskType type, @Nullable String path, @NotNull ObjectId objectId) {
  this.type = type;
  this.path = path;
  this.objectId = objectId.copy();
  if (type.needPath() == (path == null)) {
    throw new IllegalStateException();
  }
}
 
Example 2
Source File: CacheRevision.java    From git-as-svn with GNU General Public License v2.0 4 votes vote down vote up
public CacheRevision(@Nullable ObjectId commitId, Map<String, String> renames, Map<String, CacheChange> fileChange) {
  this.gitCommitId = commitId == null ? null : commitId.copy();
  this.renames.putAll(renames);
  this.fileChange.putAll(fileChange);
}
 
Example 3
Source File: CacheChange.java    From git-as-svn with GNU General Public License v2.0 4 votes vote down vote up
public CacheChange(@Nullable ObjectId oldFile, @Nullable ObjectId newFile) {
  this.oldFile = oldFile != null ? oldFile.copy() : null;
  this.newFile = newFile != null ? newFile.copy() : null;
}