Class Branch

All Implemented Interfaces:
Serializable

public class Branch extends GitObject
Represents a git branch.
See Also:
  • Constructor Details

    • Branch

      public Branch(String name, org.eclipse.jgit.lib.ObjectId sha1)
      Constructor for Branch.
      Parameters:
      name - branch name
      sha1 - object ID to which branch name points
    • Branch

      public Branch(org.eclipse.jgit.lib.Ref candidate)
      Constructor for Branch.
      Parameters:
      candidate - reference to which branch points (or should point)
  • Method Details

    • toString

      public String toString()
      Returns branch name and SHA1 hash.
      Overrides:
      toString in class Object
      Returns:
      branch name and SHA1 hash
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. Considers sha1 and name in the calculation.
      Overrides:
      hashCode in class GitObject
      Returns:
      a hash code value for this object.
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one. Includes sha1 and name in the comparison. Objects of subclasses of this object are not equal to objects of this class, even if they add no fields.
      Overrides:
      equals in class GitObject
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise