Interface RefSyncStatus


public interface RefSyncStatus
Describes the synchronization status for a given repository. If synchronization is not enabled, the following collections will always be empty: Even if synchronization is enabled, it is not guaranteed to be available. If synchronization is not available and enabled, it will not be performed.
  • Method Details

    • getLastSync

      @Nonnull Date getLastSync()
      Retrieves the time at which refs were most recently synchronized from upstream. Synchronization is performed incrementally, meaning it is likely only a subset of the repository's refs were affected. If synchronization was once enabled but is currently disabled, this is the time of the last synchronization prior to it being disabled.
      Returns:
      the time at which refs were most recently synchronized from upstream for this repository
    • getAheadRefs

      @Nonnull Set<RejectedRef> getAheadRefs()
      Retrieves a set of refs which are strictly ahead of their upstream refs. These refs include local changes which have not been merged to upstream, as well as all of the commit that are available upstream.

      The DISCARD action may be used to throw away the local changes and revert to the upstream commit.

      Returns:
      a set containing zero or more refs which are strictly ahead of upstream
    • getDivergedRefs

      @Nonnull Set<RejectedRef> getDivergedRefs()
      Retrieves a set of refs which have diverged from their upstream refs. Unlike refs which are ahead, diverged refs include changes which have not been merged to upstream but are missing some commits that are available upstream.

      The following actions may be performed on diverged refs:

      • DISCARD may be used to throw away the local changes and pull in the new commits available upstream
      • MERGE may be used to merge in the new upstream commits, which will leave the ref strictly ahead
        • Note that, after performing a merge, the ref will move to the ahead collection; it is still not considered to be in sync with upstream
      Returns:
      a set containing zero or more refs which have diverged from upstream
    • getOrphanedRefs

      @Nonnull Set<RejectedRef> getOrphanedRefs()
      Retrieves a set of refs which have been orphaned and no longer have upstream refs. If a ref in a given repository is not referring to the same commit as its upstream ref and the upstream ref is deleted, the local ref is not automatically deleted and instead becomes orphaned. Additionally, refs which are pushed to the local repository without being pushed to the upstream repository are also marked as orphaned.

      The DISCARD action may be used to delete the local ref, "synchronizing" it with the state it has upstream (which is to say, no state at all).

      Returns:
      a set containing zero or more refs which have been orphaned and no longer exist upstream
    • isAvailable

      boolean isAvailable()
      Retrieves a flag indicating whether synchronization is available for the repository. In order to enable synchronization, if it is not enabled, it must be available. However, even after synchronization has been enabled, it is possible for it to cease to be available.
      Returns:
      true if synchronization is available for the repository; otherwise, false
      See Also:
    • isEnabled

      boolean isEnabled()
      Retrieves a flag indicating whether synchronization is enabled for the repository.
      Returns:
      true if synchronization has been requested; otherwise, false if upstream changes should not be automatically propagated
      See Also: