Documentation
¶
Index ¶
- Variables
- func CloneRepository(ctx context.Context, fs billy.Filesystem, path, endpoint, id, token string) (*git.Repository, error)
- func Download(ctx context.Context, job *library.Job) error
- func FetchChanges(ctx context.Context, r borges.Repository, remote string, token string) error
- func PrepareRepository(ctx context.Context, lib *siva.Library, locID borges.LocationID, ...) (borges.Repository, error)
- func RootCommit(repo *git.Repository, remote string) (*object.Commit, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotDownloadJob is returned when a not download job is found. ErrNotDownloadJob = errors.NewKind("not download job") // ErrRepoAlreadyExists is returned if there is an attempt to // retrieve an already downloaded git repository. ErrRepoAlreadyExists = errors.NewKind("%s already downloaded") )
var ( // ErrObjectTypeNotSupported returned by ResolveCommit when the // referenced object isn't a Commit nor a Tag. ErrObjectTypeNotSupported = errors.NewKind( "object type %q not supported") )
Functions ¶
func CloneRepository ¶ added in v0.0.3
func CloneRepository( ctx context.Context, fs billy.Filesystem, path, endpoint, id, token string, ) (*git.Repository, error)
CloneRepository clones a git repository from the given endpoint into the billy.Filesystem. A remote with the id is created for that.
func Download ¶
Download is a library.JobFn function to download a git repository and store it in a borges.Library.
func FetchChanges ¶ added in v0.0.3
FetchChanges fetches changes for the given remote into the borges.Repository.
func PrepareRepository ¶ added in v0.0.3
func PrepareRepository( ctx context.Context, lib *siva.Library, locID borges.LocationID, repoID borges.RepositoryID, endpoint string, tmp billy.Filesystem, clonePath string, ) (borges.Repository, error)
PrepareRepository returns a borges.Repository ready to fetch changes. It creates a rooted repository copying the cloned repository in tmp to the siva file the library uses at the location with the given location ID, creating this location if not exists.
func RootCommit ¶ added in v0.0.3
RootCommit traverse the commit history for the given remote following the first parent of each commit. The root commit found (commit with no parents) is returned.
Types ¶
This section is empty.