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>
askFor
Set of refs we will actually wind up asking to obtain.private FetchConnection
conn
private java.util.ArrayList<FetchHeadRecord>
fetchHeadUpdates
Records to be recorded into FETCH_HEAD.private java.util.HashSet<ObjectId>
have
Objects we know we have locally.private java.util.Map<java.lang.String,Ref>
localRefs
private java.util.ArrayList<TrackingRefUpdate>
localUpdates
Updates to local tracking branches (if any).private java.util.ArrayList<PackLock>
packLocks
private java.util.Collection<RefSpec>
toFetch
List of things we want to fetch from the remote repository.private Transport
transport
Transport 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 void
addUpdateBatchCommands(FetchResult result, BatchRefUpdate batch)
private boolean
askForIsComplete()
private void
closeConnection(FetchResult result)
private TrackingRefUpdate
createUpdate(RefSpec spec, ObjectId newId)
private void
deleteStaleTrackingRefs(FetchResult result, BatchRefUpdate batch)
private void
deleteTrackingRef(FetchResult result, BatchRefUpdate batch, RefSpec spec, Ref localRef)
(package private) void
execute(ProgressMonitor monitor, FetchResult result, java.lang.String initialBranch)
private void
executeImp(ProgressMonitor monitor, FetchResult result, java.lang.String initialBranch)
private java.util.Collection<Ref>
expandAutoFollowTags()
private void
expandFetchTags()
private void
expandSingle(RefSpec spec, java.util.Set<Ref> matched)
private void
expandWildcard(RefSpec spec, java.util.Set<Ref> matched)
private void
fetchObjects(ProgressMonitor monitor)
private static java.lang.String
getFirstFailedRefName(BatchRefUpdate batch)
private boolean
isInitialBranchMissing(java.util.Map<java.lang.String,Ref> refsMap, java.lang.String initialBranch)
private static boolean
isTag(java.lang.String name)
private static boolean
isTag(Ref r)
private boolean
localHasObject(ObjectId id)
private java.util.Map<java.lang.String,Ref>
localRefs()
private void
removeFetchHeadRecord(ObjectId want)
private void
removeTrackingRefUpdate(ObjectId want)
private void
reopenConnection()
private void
updateFETCH_HEAD(FetchResult result)
private void
want(ObjectId id)
private void
want(Ref src, RefSpec spec)
private void
wantTag(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)
-
-