Interface RefSyncStatus
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a set ofrefs
which arestrictly ahead
of their upstream refs.Retrieves the time at which refs were most recently synchronized from upstream.boolean
Retrieves a flag indicating whether synchronization is available for the repository.boolean
Retrieves a flag indicating whether synchronization is enabled for the repository.
-
Method Details
-
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
Retrieves a set ofrefs
which arestrictly 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
Retrieves a set ofrefs
which havediverged
from their upstream refs. Unlike refs which areahead
, 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 upstreamMERGE
may be used to merge in the new upstream commits, which will leave the refstrictly 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
- Note that, after performing a merge, the ref will move to the
- Returns:
- a set containing zero or more refs which have diverged from upstream
-
getOrphanedRefs
Retrieves a set ofrefs
which have beenorphaned
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:
-