aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo_commit_nogogit.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/repo_commit_nogogit.go')
-rw-r--r--modules/git/repo_commit_nogogit.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/git/repo_commit_nogogit.go b/modules/git/repo_commit_nogogit.go
index a7031184e2..ae4c21aaa3 100644
--- a/modules/git/repo_commit_nogogit.go
+++ b/modules/git/repo_commit_nogogit.go
@@ -132,8 +132,11 @@ func (repo *Repository) getCommitFromBatchReader(rd *bufio.Reader, id ObjectID)
// ConvertToGitID returns a GitHash object from a potential ID string
func (repo *Repository) ConvertToGitID(commitID string) (ObjectID, error) {
- IDType := repo.objectFormat
- if len(commitID) == IDType.FullLength() && IDType.IsValid(commitID) {
+ objectFormat, err := repo.GetObjectFormat()
+ if err != nil {
+ return nil, err
+ }
+ if len(commitID) == objectFormat.FullLength() && objectFormat.IsValid(commitID) {
ID, err := NewIDFromString(commitID)
if err == nil {
return ID, nil
@@ -142,7 +145,7 @@ func (repo *Repository) ConvertToGitID(commitID string) (ObjectID, error) {
wr, rd, cancel := repo.CatFileBatchCheck(repo.Ctx)
defer cancel()
- _, err := wr.Write([]byte(commitID + "\n"))
+ _, err = wr.Write([]byte(commitID + "\n"))
if err != nil {
return nil, err
}