Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion submitqueue/extension/changeprovider/git/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,25 @@ func newFixture(t *testing.T) *fixture {
work: filepath.Join(root, "work"),
}

// Every repository in this fixture disables auto-maintenance so cleanup cannot race a background repack.
f.run("", "init", "--bare", "-b", "main", f.remote)
f.run(f.remote, "config", "maintenance.auto", "false")
Comment thread
sbalabanov marked this conversation as resolved.
Resolved
f.run("", "clone", f.remote, f.work)
f.run(f.work, "config", "user.name", "Test")
f.run(f.work, "config", "user.email", "test@example.invalid")
f.run(f.work, "config", "maintenance.auto", "false")
Comment thread
sbalabanov marked this conversation as resolved.
Resolved
f.write("seed.txt", "seed\n")
f.run(f.work, "add", ".")
f.run(f.work, "commit", "-m", "seed")
f.run(f.work, "push", "origin", "main")

copyPath := filepath.Join(root, "copy.git")
f.run("", "init", "--bare", "-b", "main", copyPath)
f.run(copyPath, "config", "maintenance.auto", "false")

repo, err := gitrepo.NewRepo(gitrepo.RepoConfig{
Git: git,
Path: filepath.Join(root, "copy.git"),
Path: copyPath,
RemoteURL: f.remote,
Target: "main",
})
Expand Down Expand Up @@ -300,6 +307,7 @@ func TestGet_UnrelatedHistoryIsAnError(t *testing.T) {
f.run("", "clone", f.remote, orphan)
f.run(orphan, "config", "user.name", "Test")
f.run(orphan, "config", "user.email", "test@example.invalid")
f.run(orphan, "config", "maintenance.auto", "false")
f.run(orphan, "checkout", "--orphan", "feature/orphan")
f.run(orphan, "rm", "-rf", ".")
require.NoError(t, os.WriteFile(filepath.Join(orphan, "alone.txt"), []byte("alone\n"), 0o644))
Expand Down