Package org.eclipse.jgit.transport
Class FetchProcess
- java.lang.Object
-
- org.eclipse.jgit.transport.FetchProcess
-
class FetchProcess extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap<ObjectId,Ref>askForSet of refs we will actually wind up asking to obtain.private FetchConnectionconnprivate java.util.ArrayList<FetchHeadRecord>fetchHeadUpdatesRecords to be recorded into FETCH_HEAD.private java.util.HashSet<ObjectId>haveObjects we know we have locally.private java.util.Map<java.lang.String,Ref>localRefsprivate java.util.ArrayList<TrackingRefUpdate>localUpdatesUpdates to local tracking branches (if any).private java.util.ArrayList<PackLock>packLocksprivate java.util.Collection<RefSpec>toFetchList of things we want to fetch from the remote repository.private TransporttransportTransport we will fetch over.
-
Constructor Summary
Constructors Constructor Description FetchProcess(Transport t, java.util.Collection<RefSpec> f)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddUpdateBatchCommands(FetchResult result, BatchRefUpdate batch)private booleanaskForIsComplete()private voidcloseConnection(FetchResult result)private TrackingRefUpdatecreateUpdate(RefSpec spec, ObjectId newId)private voiddeleteStaleTrackingRefs(FetchResult result, BatchRefUpdate batch)private voiddeleteTrackingRef(FetchResult result, BatchRefUpdate batch, RefSpec spec, Ref localRef)(package private) voidexecute(ProgressMonitor monitor, FetchResult result, java.lang.String initialBranch)private voidexecuteImp(ProgressMonitor monitor, FetchResult result, java.lang.String initialBranch)private java.util.Collection<Ref>expandAutoFollowTags()private voidexpandFetchTags()private voidexpandSingle(RefSpec spec, java.util.Set<Ref> matched)private voidexpandWildcard(RefSpec spec, java.util.Set<Ref> matched)private voidfetchObjects(ProgressMonitor monitor)private static java.lang.StringgetFirstFailedRefName(BatchRefUpdate batch)private booleanisInitialBranchMissing(java.util.Map<java.lang.String,Ref> refsMap, java.lang.String initialBranch)private static booleanisTag(java.lang.String name)private static booleanisTag(Ref r)private booleanlocalHasObject(ObjectId id)private java.util.Map<java.lang.String,Ref>localRefs()private voidremoveFetchHeadRecord(ObjectId want)private voidremoveTrackingRefUpdate(ObjectId want)private voidreopenConnection()private voidupdateFETCH_HEAD(FetchResult result)private voidwant(ObjectId id)private voidwant(Ref src, RefSpec spec)private voidwantTag(Ref r)
-
-
-
Field Detail
-
transport
private final Transport transport
Transport we will fetch over.
-
toFetch
private final java.util.Collection<RefSpec> toFetch
List of things we want to fetch from the remote repository.
-
askFor
private final java.util.HashMap<ObjectId,Ref> askFor
Set of refs we will actually wind up asking to obtain.
-
have
private final java.util.HashSet<ObjectId> have
Objects we know we have locally.
-
localUpdates
private final java.util.ArrayList<TrackingRefUpdate> localUpdates
Updates to local tracking branches (if any).
-
fetchHeadUpdates
private final java.util.ArrayList<FetchHeadRecord> fetchHeadUpdates
Records to be recorded into FETCH_HEAD.
-
packLocks
private final java.util.ArrayList<PackLock> packLocks
-
conn
private FetchConnection conn
-
localRefs
private java.util.Map<java.lang.String,Ref> localRefs
-
-
Method Detail
-
execute
void execute(ProgressMonitor monitor, FetchResult result, java.lang.String initialBranch) throws NotSupportedException, TransportException
-
isInitialBranchMissing
private boolean isInitialBranchMissing(java.util.Map<java.lang.String,Ref> refsMap, java.lang.String initialBranch)
-
executeImp
private void executeImp(ProgressMonitor monitor, FetchResult result, java.lang.String initialBranch) throws NotSupportedException, TransportException
-
addUpdateBatchCommands
private void addUpdateBatchCommands(FetchResult result, BatchRefUpdate batch) throws TransportException
- Throws:
TransportException
-
fetchObjects
private void fetchObjects(ProgressMonitor monitor) throws TransportException
- Throws:
TransportException
-
closeConnection
private void closeConnection(FetchResult result)
-
reopenConnection
private void reopenConnection() throws NotSupportedException, TransportException
-
removeTrackingRefUpdate
private void removeTrackingRefUpdate(ObjectId want)
-
removeFetchHeadRecord
private void removeFetchHeadRecord(ObjectId want)
-
updateFETCH_HEAD
private void updateFETCH_HEAD(FetchResult result) throws java.io.IOException
- Throws:
java.io.IOException
-
askForIsComplete
private boolean askForIsComplete() throws TransportException- Throws:
TransportException
-
expandWildcard
private void expandWildcard(RefSpec spec, java.util.Set<Ref> matched) throws TransportException
- Throws:
TransportException
-
expandSingle
private void expandSingle(RefSpec spec, java.util.Set<Ref> matched) throws TransportException
- Throws:
TransportException
-
localHasObject
private boolean localHasObject(ObjectId id) throws TransportException
- Throws:
TransportException
-
expandAutoFollowTags
private java.util.Collection<Ref> expandAutoFollowTags() throws TransportException
- Throws:
TransportException
-
expandFetchTags
private void expandFetchTags() throws TransportException- Throws:
TransportException
-
wantTag
private void wantTag(Ref r) throws TransportException
- Throws:
TransportException
-
want
private void want(Ref src, RefSpec spec) throws TransportException
- Throws:
TransportException
-
want
private void want(ObjectId id)
-
createUpdate
private TrackingRefUpdate createUpdate(RefSpec spec, ObjectId newId) throws TransportException
- Throws:
TransportException
-
localRefs
private java.util.Map<java.lang.String,Ref> localRefs() throws TransportException
- Throws:
TransportException
-
deleteStaleTrackingRefs
private void deleteStaleTrackingRefs(FetchResult result, BatchRefUpdate batch) throws java.io.IOException
- Throws:
java.io.IOException
-
deleteTrackingRef
private void deleteTrackingRef(FetchResult result, BatchRefUpdate batch, RefSpec spec, Ref localRef)
-
isTag
private static boolean isTag(Ref r)
-
isTag
private static boolean isTag(java.lang.String name)
-
getFirstFailedRefName
private static java.lang.String getFirstFailedRefName(BatchRefUpdate batch)
-
-