Skip to content

Commit 533687c

Browse files
committed
test
1 parent 46fb5b1 commit 533687c

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

modules/git/repo_base_nogogit.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package git
99
import (
1010
"context"
1111
"path/filepath"
12-
"sync"
1312

1413
"code.gitea.io/gitea/modules/log"
1514
"code.gitea.io/gitea/modules/util"
@@ -25,7 +24,6 @@ type Repository struct {
2524

2625
gpgSettings *GPGSettings
2726

28-
mu sync.Mutex
2927
catFileBatchCloser CatFileBatchCloser
3028
catFileBatchInUse bool
3129

@@ -65,9 +63,6 @@ func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
6563

6664
// CatFileBatch obtains a CatFileBatch for this repository
6765
func (repo *Repository) CatFileBatch(ctx context.Context, optAlwaysNewBatch ...bool) (_ CatFileBatch, closeFunc func(), err error) {
68-
repo.mu.Lock()
69-
defer repo.mu.Unlock()
70-
7166
if util.OptionalArg(optAlwaysNewBatch) {
7267
b, err := NewBatch(ctx, repo.Path)
7368
return b, b.Close, err
@@ -83,8 +78,6 @@ func (repo *Repository) CatFileBatch(ctx context.Context, optAlwaysNewBatch ...b
8378
if !repo.catFileBatchInUse {
8479
repo.catFileBatchInUse = true
8580
return CatFileBatch(repo.catFileBatchCloser), func() {
86-
repo.mu.Lock()
87-
defer repo.mu.Unlock()
8881
repo.catFileBatchInUse = false
8982
}, nil
9083
}

modules/git/repo_commit_nogogit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (repo *Repository) ResolveReference(name string) (string, error) {
3636

3737
// GetRefCommitID returns the last commit ID string of given reference (branch or tag).
3838
func (repo *Repository) GetRefCommitID(name string) (string, error) {
39-
batch, cancel, err := repo.CatFileBatch(repo.Ctx, true)
39+
batch, cancel, err := repo.CatFileBatch(repo.Ctx, true) // here is the real fatal point?
4040
if err != nil {
4141
return "", err
4242
}

tests/integration/repo_commits_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ func TestRepoCommitsStatusParallel(t *testing.T) {
193193
wg.Add(1)
194194
go func(parentT *testing.T, i int) {
195195
parentT.Run(fmt.Sprintf("ParallelCreateStatus_%d", i), func(t *testing.T) {
196+
defer wg.Done()
196197
ctx := NewAPITestContext(t, "user2", "repo1", auth_model.AccessTokenScopeWriteRepository)
197198
runBody := doAPICreateCommitStatus(ctx, path.Base(commitURL), api.CreateStatusOption{
198199
State: commitstatus.CommitStatusPending,
@@ -201,7 +202,6 @@ func TestRepoCommitsStatusParallel(t *testing.T) {
201202
Context: "testci",
202203
})
203204
runBody(t)
204-
wg.Done()
205205
})
206206
}(t, i)
207207
}

0 commit comments

Comments
 (0)