1// Package repository contains helper methods for working with a Git repo.
2package repository
3
4type Hash string
5
6// Repo represents a source code repository.
7type Repo interface {
8 // GetPath returns the path to the repo.
9 GetPath() string
10
11 // GetUserName returns the name the the user has used to configure git
12 GetUserName() (string, error)
13
14 // GetUserEmail returns the email address that the user has used to configure git.
15 GetUserEmail() (string, error)
16
17 // GetCoreEditor returns the name of the editor that the user has used to configure git.
18 GetCoreEditor() (string, error)
19
20 // PullRefs pull git refs from a remote
21 PullRefs(remote string, refPattern string) error
22
23 // PushRefs push git refs to a remote
24 PushRefs(remote string, refPattern string) error
25
26 // StoreData will store arbitrary data and return the corresponding hash
27 StoreData([]byte) (Hash, error)
28}