Example usage for org.eclipse.jgit.lib AnyObjectId copy

List of usage examples for org.eclipse.jgit.lib AnyObjectId copy

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib AnyObjectId copy.

Prototype

public final ObjectId copy() 

Source Link

Document

Obtain an immutable copy of this current object name value.

Usage

From source file:com.google.gerrit.server.patch.PatchList.java

License:Apache License

PatchList(@Nullable final AnyObjectId oldId, final AnyObjectId newId, final boolean againstParent,
        final PatchListEntry[] patches) {
    this.oldId = oldId != null ? oldId.copy() : null;
    this.newId = newId.copy();
    this.againstParent = againstParent;

    // We assume index 0 contains the magic commit message entry.
    if (patches.length > 1) {
        Arrays.sort(patches, 1, patches.length, PATCH_CMP);
    }/*from   w  ww .  jav a  2s .c  o  m*/
    for (int i = 1; i < patches.length; i++) {
        insertions += patches[i].getInsertions();
        deletions += patches[i].getDeletions();
    }

    this.patches = patches;
}

From source file:com.google.gerrit.server.patch.PatchListKey.java

License:Apache License

public PatchListKey(AnyObjectId a, AnyObjectId b, Whitespace ws) {
    oldId = a != null ? a.copy() : null;
    newId = b.copy();
    whitespace = ws;
}

From source file:it.com.atlassian.labs.speakeasy.util.jgit.WalkFetchConnection.java

License:Eclipse Distribution License

private void recordError(final AnyObjectId id, final Throwable what) {
    final ObjectId objId = id.copy();
    List<Throwable> errors = fetchErrors.get(objId);
    if (errors == null) {
        errors = new ArrayList<Throwable>(2);
        fetchErrors.put(objId, errors);//ww  w.  ja  v  a  2  s .  c o m
    }
    errors.add(what);
}

From source file:org.craftercms.studio.impl.v1.util.git.CherryPickCommandEx.java

License:Eclipse Distribution License

/**
 * @param name/*from www .  jav a 2s.  co m*/
 *            a name given to the commit
 * @param commit
 *            the Id of a commit which is cherry-picked to the current head
 * @return {@code this}
 */
public CherryPickCommandEx include(String name, AnyObjectId commit) {
    return include(new ObjectIdRef.Unpeeled(Storage.LOOSE, name, commit.copy()));
}

From source file:org.eclipse.egit.ui.internal.decorators.GitDocument.java

License:Open Source License

private void setResolved(final AnyObjectId commit, final AnyObjectId tree, final AnyObjectId blob,
        final String value) {
    lastCommit = commit != null ? commit.copy() : null;
    lastTree = tree != null ? tree.copy() : null;
    lastBlob = blob != null ? blob.copy() : null;
    set(value);//  w w w. j  a  v  a2s  . c  om
    if (blob != null)
        if (GitTraceLocation.QUICKDIFF.isActive())
            GitTraceLocation.getTrace().trace(GitTraceLocation.QUICKDIFF.getLocation(),
                    "(GitDocument) resolved " + resource + " to " + lastBlob + " in " + lastCommit + "/" //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
                            + lastTree);
        else if (GitTraceLocation.QUICKDIFF.isActive())
            GitTraceLocation.getTrace().trace(GitTraceLocation.QUICKDIFF.getLocation(),
                    "(GitDocument) unresolved " + resource); //$NON-NLS-1$
}