Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-08-05 11:02:11 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-08-05 11:10:02 +0300
commit4ed3ef858ae31523b3401f3d50693303efbb645b (patch)
treef4d412adfae214ac4d1e4a26e5613cb28b6569c6
parentc1c10144cffd232130df0e2a24e92b8c8705773f (diff)
lstree: Detect object hash in `ListEntries()`
Detect the object hash used by the repository for which we should list tree entries to support SHA256-based repositories.
-rw-r--r--internal/git/lstree/list_entries.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/git/lstree/list_entries.go b/internal/git/lstree/list_entries.go
index 28d38a0ad..24156c7a7 100644
--- a/internal/git/lstree/list_entries.go
+++ b/internal/git/lstree/list_entries.go
@@ -60,7 +60,12 @@ func ListEntries(
return nil, fmt.Errorf("spawning git-ls-tree: %w", err)
}
- parser := NewParser(cmd, git.ObjectHashSHA1)
+ objectHash, err := repo.ObjectHash(ctx)
+ if err != nil {
+ return nil, fmt.Errorf("detecting object hash: %w", err)
+ }
+
+ parser := NewParser(cmd, objectHash)
var entries []*Entry
for {
entry, err := parser.NextEntry()