Package org.eclipse.jgit.lib
Class RefWriter
java.lang.Object
org.eclipse.jgit.lib.RefWriter
Writes out refs to the
Constants.INFO_REFS
and
Constants.PACKED_REFS
files.
This class is abstract as the writing of the files must be handled by the
caller. This is because it is used by transport classes as well.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Handles actual writing of ref files to the git repository, which may differ slightly depending on the destination and transport.void
Rebuild theConstants.INFO_REFS
.void
Rebuild theConstants.PACKED_REFS
file.
-
Field Details
-
refs
-
-
Constructor Details
-
RefWriter
Constructor for RefWriter.
- Parameters:
refs
- the complete set of references. This should have been computed by applying updates to the advertised refs already discovered.
-
RefWriter
Constructor for RefWriter.
- Parameters:
refs
- the complete set of references. This should have been computed by applying updates to the advertised refs already discovered.
-
RefWriter
Constructor for RefWriter.
- Parameters:
refs
- the complete set of references. This should have been computed by applying updates to the advertised refs already discovered.
-
-
Method Details
-
writeInfoRefs
Rebuild theConstants.INFO_REFS
.This method rebuilds the contents of the
Constants.INFO_REFS
file to match the passed list of references.- Throws:
IOException
- writing is not supported, or attempting to write the file failed, possibly due to permissions or remote disk full, etc.
-
writePackedRefs
Rebuild theConstants.PACKED_REFS
file.This method rebuilds the contents of the
Constants.PACKED_REFS
file to match the passed list of references, including only those refs that have a storage type ofRef.Storage.PACKED
.- Throws:
IOException
- writing is not supported, or attempting to write the file failed, possibly due to permissions or remote disk full, etc.
-
writeFile
Handles actual writing of ref files to the git repository, which may differ slightly depending on the destination and transport.- Parameters:
file
- path to ref file.content
- byte content of file to be written.- Throws:
IOException
-