Package org.eclipse.jgit.lfs
Class LfsPrePushHook
java.lang.Object
org.eclipse.jgit.hooks.GitHook<String>
org.eclipse.jgit.hooks.PrePushHook
org.eclipse.jgit.lfs.LfsPrePushHook
Pre-push hook that handles uploading LFS artefacts.
- Since:
- 4.11
-
Field Summary
FieldsFields inherited from class org.eclipse.jgit.hooks.PrePushHook
NAME -
Constructor Summary
ConstructorsConstructorDescriptionLfsPrePushHook(Repository repo, PrintStream outputStream) LfsPrePushHook(Repository repo, PrintStream outputStream, PrintStream errorStream) -
Method Summary
Modifier and TypeMethodDescriptioncall()private voidexcludeRemoteRefs(ObjectWalk walk) private static voidfindLfsPointers(Set<LfsPointer> toPush, ObjectWalk walk) private Set<LfsPointer>private static longgetObjectSize(ObjectReader r, RevObject obj) private static LfsPointerloadLfsPointer(ObjectReader r, AnyObjectId obj) private List<Protocol.ObjectInfo>parseObjects(com.google.gson.stream.JsonReader reader) private Stringremote()private Map<String,LfsPointer> requestBatchUpload(HttpConnection api, Set<LfsPointer> toPush) voidsetRefs(Collection<RemoteRefUpdate> toRefs) Set Refsprivate voiduploadContents(HttpConnection api, Map<String, LfsPointer> oid2ptr) private voiduploadFile(Protocol.ObjectInfo o, Protocol.Action uploadAction, Path path) Methods inherited from class org.eclipse.jgit.hooks.PrePushHook
getHookName, getParameters, getRemoteName, getStdinArgs, setRemoteLocation, setRemoteNameMethods inherited from class org.eclipse.jgit.hooks.GitHook
doRun, getErrorStream, getOutputStream, getRepository, handleError, isNativeHookPresent
-
Field Details
-
EMPTY
- See Also:
-
refs
-
-
Constructor Details
-
LfsPrePushHook
- Parameters:
repo- the repositoryoutputStream- not used by this implementation
-
LfsPrePushHook
- Parameters:
repo- the repositoryoutputStream- not used by this implementationerrorStream- not used by this implementation- Since:
- 5.6
-
-
Method Details
-
setRefs
Description copied from class:PrePushHookSet Refs- Overrides:
setRefsin classPrePushHook- Parameters:
toRefs- a collection ofRemoteRefUpdates
-
call
Description copied from class:PrePushHookRun the hook.
- Specified by:
callin interfaceCallable<String>- Overrides:
callin classPrePushHook- Throws:
IOExceptionAbortedByHookException
-
findObjectsToPush
private Set<LfsPointer> findObjectsToPush() throws IOException, MissingObjectException, IncorrectObjectTypeException -
findLfsPointers
private static void findLfsPointers(Set<LfsPointer> toPush, ObjectWalk walk) throws MissingObjectException, IncorrectObjectTypeException, IOException -
getObjectSize
- Throws:
IOException
-
loadLfsPointer
- Throws:
IOException
-
excludeRemoteRefs
- Throws:
IOException
-
remote
-
requestBatchUpload
private Map<String,LfsPointer> requestBatchUpload(HttpConnection api, Set<LfsPointer> toPush) throws IOException - Throws:
IOException
-
uploadContents
- Throws:
IOException
-
parseObjects
-
uploadFile
private void uploadFile(Protocol.ObjectInfo o, Protocol.Action uploadAction, Path path) throws IOException, CorruptMediaFile - Throws:
IOExceptionCorruptMediaFile
-