aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/tree_nogogit.go
diff options
context:
space:
mode:
authorAdam Majer <amajer@suse.de>2023-12-13 21:02:00 +0000
committerGitHub <noreply@github.com>2023-12-13 21:02:00 +0000
commitcbf923e87bca0f50c2c01a60ccf544b63c365e98 (patch)
tree9e2e66c688bdc0f740e1ae333847dfb33677c730 /modules/git/tree_nogogit.go
parent064f05204c0539d1f92895776dee7f626a628e3b (diff)
downloadgitea-cbf923e87bca0f50c2c01a60ccf544b63c365e98.tar.gz
gitea-cbf923e87bca0f50c2c01a60ccf544b63c365e98.zip
Abstract hash function usage (#28138)
Refactor Hash interfaces and centralize hash function. This will allow easier introduction of different hash function later on. This forms the "no-op" part of the SHA256 enablement patch.
Diffstat (limited to 'modules/git/tree_nogogit.go')
-rw-r--r--modules/git/tree_nogogit.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/git/tree_nogogit.go b/modules/git/tree_nogogit.go
index ef598d7e91..89d3aebbc0 100644
--- a/modules/git/tree_nogogit.go
+++ b/modules/git/tree_nogogit.go
@@ -13,8 +13,8 @@ import (
// Tree represents a flat directory listing.
type Tree struct {
- ID SHA1
- ResolvedID SHA1
+ ID ObjectID
+ ResolvedID ObjectID
repo *Repository
// parent tree
@@ -54,7 +54,7 @@ func (t *Tree) ListEntries() (Entries, error) {
}
}
if typ == "tree" {
- t.entries, err = catBatchParseTreeEntries(t, rd, sz)
+ t.entries, err = catBatchParseTreeEntries(t.ID.Type(), t, rd, sz)
if err != nil {
return nil, err
}
@@ -90,7 +90,7 @@ func (t *Tree) ListEntries() (Entries, error) {
}
var err error
- t.entries, err = parseTreeEntries(stdout, t)
+ t.entries, err = parseTreeEntries(t.repo.objectFormat, stdout, t)
if err == nil {
t.entriesParsed = true
}
@@ -114,7 +114,7 @@ func (t *Tree) listEntriesRecursive(extraArgs TrustedCmdArgs) (Entries, error) {
}
var err error
- t.entriesRecursive, err = parseTreeEntries(stdout, t)
+ t.entriesRecursive, err = parseTreeEntries(t.repo.objectFormat, stdout, t)
if err == nil {
t.entriesRecursiveParsed = true
}