diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-17 01:52:56 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-17 01:52:56 +0200 |
commit | 0180b68cb0bb3aecf9b4a6186094a084762b4a25 (patch) | |
tree | 95597554cfdda76b9f6cc5aab7c3fd5b24a3db75 /repository/repo.go | |
parent | 1d678dfdfa026968dbb19795c9bed16385603b21 (diff) | |
download | git-bug-0180b68cb0bb3aecf9b4a6186094a084762b4a25.tar.gz |
implement pull/merge
Diffstat (limited to 'repository/repo.go')
-rw-r--r-- | repository/repo.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/repository/repo.go b/repository/repo.go index 26fe0fa6..7ba8a8b5 100644 --- a/repository/repo.go +++ b/repository/repo.go @@ -21,8 +21,8 @@ type Repo interface { // GetCoreEditor returns the name of the editor that the user has used to configure git. GetCoreEditor() (string, error) - // PullRefs pull git refs from a remote - PullRefs(remote string, refPattern string, remoteRefPattern string) error + // FetchRefs fetch git refs from a remote + FetchRefs(remote string, refPattern string, remoteRefPattern string) error // PushRefs push git refs to a remote PushRefs(remote string, refPattern string) error @@ -48,11 +48,23 @@ type Repo interface { // ListRefs will return a list of Git ref matching the given refspec ListRefs(refspec string) ([]string, error) + // RefExist will check if a reference exist in Git + RefExist(ref string) (bool, error) + + // CopyRef will create a new reference with the same value as another one + CopyRef(source string, dest string) error + // ListCommits will return the list of tree hashes of a ref, in chronological order ListCommits(ref string) ([]util.Hash, error) // ListEntries will return the list of entries in a Git tree ListEntries(hash util.Hash) ([]TreeEntry, error) + + // FindCommonAncestor will return the last common ancestor of two chain of commit + FindCommonAncestor(hash1 util.Hash, hash2 util.Hash) (util.Hash, error) + + // Return the git tree hash referenced in a commit + GetTreeHash(commit util.Hash) (util.Hash, error) } func prepareTreeEntries(entries []TreeEntry) bytes.Buffer { |