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-07-18 13:33:46 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-20 07:39:11 +0300
commit879da72e1478b558246a8a81553a816b362bdad7 (patch)
tree072c4de69f0613965c13a8c56226ed3bb62ceded /internal/git2go
parent1df3c350409a330bd35e5bd3da5baaa1b98a9e6f (diff)
git: Move `NewObjectIDFromHex()` into `ObjectHash` structure
Move the `NewObjectIDFromHex()` function into the `ObjectHash` structure to make it dependent on the hash function used.
Diffstat (limited to 'internal/git2go')
-rw-r--r--internal/git2go/apply.go2
-rw-r--r--internal/git2go/commit.go2
-rw-r--r--internal/git2go/executor.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/internal/git2go/apply.go b/internal/git2go/apply.go
index 600890ca0..2bee12857 100644
--- a/internal/git2go/apply.go
+++ b/internal/git2go/apply.go
@@ -118,7 +118,7 @@ func (b *Executor) Apply(ctx context.Context, repo repository.GitRepo, params Ap
return "", result.Err
}
- commitID, err := git.NewObjectIDFromHex(result.CommitID)
+ commitID, err := git.ObjectHashSHA1.FromHex(result.CommitID)
if err != nil {
return "", fmt.Errorf("could not parse commit ID: %w", err)
}
diff --git a/internal/git2go/commit.go b/internal/git2go/commit.go
index 068125d5b..13edb4faa 100644
--- a/internal/git2go/commit.go
+++ b/internal/git2go/commit.go
@@ -80,7 +80,7 @@ func (b *Executor) Commit(ctx context.Context, repo repository.GitRepo, params C
return "", result.Err
}
- commitID, err := git.NewObjectIDFromHex(result.CommitID)
+ commitID, err := git.ObjectHashSHA1.FromHex(result.CommitID)
if err != nil {
return "", fmt.Errorf("could not parse commit ID: %w", err)
}
diff --git a/internal/git2go/executor.go b/internal/git2go/executor.go
index 264f34a56..7d8e728b5 100644
--- a/internal/git2go/executor.go
+++ b/internal/git2go/executor.go
@@ -124,7 +124,7 @@ func (b *Executor) runWithGob(ctx context.Context, repo repository.GitRepo, cmd
return "", fmt.Errorf("%s: %w", cmd, result.Err)
}
- commitID, err := git.NewObjectIDFromHex(result.CommitID)
+ commitID, err := git.ObjectHashSHA1.FromHex(result.CommitID)
if err != nil {
return "", fmt.Errorf("could not parse commit ID: %w", err)
}