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/mock_repo.go | |
parent | 1d678dfdfa026968dbb19795c9bed16385603b21 (diff) | |
download | git-bug-0180b68cb0bb3aecf9b4a6186094a084762b4a25.tar.gz |
implement pull/merge
Diffstat (limited to 'repository/mock_repo.go')
-rw-r--r-- | repository/mock_repo.go | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/repository/mock_repo.go b/repository/mock_repo.go index f526c3dc..1ac2c6e7 100644 --- a/repository/mock_repo.go +++ b/repository/mock_repo.go @@ -53,7 +53,7 @@ func (r *mockRepoForTest) PushRefs(remote string, refPattern string) error { return nil } -func (r *mockRepoForTest) PullRefs(remote string, refPattern string, remoteRefPattern string) error { +func (r *mockRepoForTest) FetchRefs(remote string, refPattern string, remoteRefPattern string) error { return nil } @@ -107,6 +107,22 @@ func (r *mockRepoForTest) UpdateRef(ref string, hash util.Hash) error { return nil } +func (r *mockRepoForTest) RefExist(ref string) (bool, error) { + _, exist := r.refs[ref] + return exist, nil +} + +func (r *mockRepoForTest) CopyRef(source string, dest string) error { + hash, exist := r.refs[source] + + if !exist { + return errors.New("Unknown ref") + } + + r.refs[dest] = hash + return nil +} + func (r *mockRepoForTest) ListRefs(refspec string) ([]string, error) { keys := make([]string, len(r.refs)) @@ -160,3 +176,11 @@ func (r *mockRepoForTest) ListEntries(hash util.Hash) ([]TreeEntry, error) { return readTreeEntries(data) } + +func (r *mockRepoForTest) FindCommonAncestor(hash1 util.Hash, hash2 util.Hash) (util.Hash, error) { + panic("implement me") +} + +func (r *mockRepoForTest) GetTreeHash(commit util.Hash) (util.Hash, error) { + panic("implement me") +} |