aboutsummaryrefslogtreecommitdiffstats
path: root/repository/repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-12-21 11:05:47 +0100
committerMichael Muré <batolettre@gmail.com>2021-02-14 12:18:59 +0100
commit5c4e7de01281da51e32b4926dc0ef15b17a2d397 (patch)
tree505bab1389c6ce3fd10427fdfa266405b7250611 /repository/repo.go
parent5f6a39145d9ac109d430190d0d352544d27b6561 (diff)
downloadgit-bug-5c4e7de01281da51e32b4926dc0ef15b17a2d397.tar.gz
repository: partially add two new functions to RepoData
Diffstat (limited to 'repository/repo.go')
-rw-r--r--repository/repo.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/repository/repo.go b/repository/repo.go
index 625e0143..afd8ff77 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -88,6 +88,12 @@ type RepoBleve interface {
ClearBleveIndex(name string) error
}
+type Commit struct {
+ Hash Hash
+ Parents []Hash
+ TreeHash Hash
+}
+
// RepoData give access to the git data storage
type RepoData interface {
// FetchRefs fetch git refs from a remote
@@ -115,11 +121,12 @@ type RepoData interface {
// StoreCommit will store a Git commit with the given Git tree
StoreCommitWithParent(treeHash Hash, parent Hash) (Hash, error)
+ ReadCommit(hash Hash) (Commit, error)
+
// GetTreeHash return the git tree hash referenced in a commit
GetTreeHash(commit Hash) (Hash, error)
- // FindCommonAncestor will return the last common ancestor of two chain of commit
- FindCommonAncestor(commit1 Hash, commit2 Hash) (Hash, error)
+ ResolveRef(ref string) (Hash, error)
// UpdateRef will create or update a Git reference
UpdateRef(ref string, hash Hash) error
@@ -136,7 +143,12 @@ type RepoData interface {
// CopyRef will create a new reference with the same value as another one
CopyRef(source string, dest string) error
+ // FindCommonAncestor will return the last common ancestor of two chain of commit
+ // Deprecated
+ FindCommonAncestor(commit1 Hash, commit2 Hash) (Hash, error)
+
// ListCommits will return the list of tree hashes of a ref, in chronological order
+ // Deprecated
ListCommits(ref string) ([]Hash, error)
}