Skip to content

Commit cc9a69c

Browse files
wolfogreGiteaBot
authored andcommitted
Add TAGS to TEST_TAGS and fix bugs found with gogit (go-gitea#31791)
Found at go-gitea#31790 (comment) `unit-tests-gogit` never work since the workflow set `TAGS` with `gogit`, but the Makefile use `TEST_TAGS`. This PR adds the values of `TAGS` to `TEST_TAGS`, ensuring that setting `TAGS` is always acceptable and avoiding confusion about which one should be set.
1 parent b1266ed commit cc9a69c

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ TAGS ?=
136136
TAGS_SPLIT := $(subst $(COMMA), ,$(TAGS))
137137
TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
138138

139-
TEST_TAGS ?= sqlite sqlite_unlock_notify
139+
TEST_TAGS ?= $(TAGS_SPLIT) sqlite sqlite_unlock_notify
140140

141141
TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR)
142142

modules/git/blame_sha256_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ func TestReadingBlameOutputSha256(t *testing.T) {
1414
ctx, cancel := context.WithCancel(context.Background())
1515
defer cancel()
1616

17+
if isGogit {
18+
t.Skip("Skipping test since gogit does not support sha256")
19+
return
20+
}
21+
1722
t.Run("Without .git-blame-ignore-revs", func(t *testing.T) {
1823
repo, err := OpenRepository(ctx, "./tests/repos/repo5_pulls_sha256")
1924
assert.NoError(t, err)

modules/git/repo_tree_gogit.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66

77
package git
88

9-
import "github.com/go-git/go-git/v5/plumbing"
9+
import (
10+
"errors"
11+
12+
"github.com/go-git/go-git/v5/plumbing"
13+
)
1014

1115
func (repo *Repository) getTree(id ObjectID) (*Tree, error) {
1216
gogitTree, err := repo.gogitRepo.TreeObject(plumbing.Hash(id.RawValue()))
1317
if err != nil {
18+
if errors.Is(err, plumbing.ErrObjectNotFound) {
19+
return nil, ErrNotExist{
20+
ID: id.String(),
21+
}
22+
}
1423
return nil, err
1524
}
1625

0 commit comments

Comments
 (0)