Skip to content

Commit b09ac68

Browse files
Fix git test hang (#4365)
For contributors who may have `tag.gpgSign` configured as a part of their local git configuration, this call will hang as it will open up `$EDITOR` to enter the message. Also, use `t.Context` over `context.Background`.
1 parent 8b38b1f commit b09ac68

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

private/pkg/git/git_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838

3939
func TestGitCloner(t *testing.T) {
4040
t.Parallel()
41-
ctx := context.Background()
41+
ctx := t.Context()
4242
container, err := app.NewContainerForOS()
4343
require.NoError(t, err)
4444
originDir, workDir := createGitDirs(ctx, t, container)
@@ -463,7 +463,7 @@ func createGitDirs(
463463
require.NoError(t, os.WriteFile(filepath.Join(originPath, "a.proto"), []byte("// commit 4"), 0600))
464464
runCommand(ctx, t, container, "git", "-C", originPath, "add", "a.proto")
465465
runCommand(ctx, t, container, "git", "-C", originPath, "commit", "-m", "commit 4")
466-
runCommand(ctx, t, container, "git", "-C", originPath, "tag", "remote-tag")
466+
runCommand(ctx, t, container, "git", "-C", originPath, "tag", "remote-tag", "--no-sign")
467467
runCommand(ctx, t, container, "git", "-C", originPath, "tag", "-a", "remote-annotated-tag", "-m", "annotated tag")
468468

469469
runCommand(ctx, t, container, "git", "-C", workPath, "fetch", "origin")

0 commit comments

Comments
 (0)