@@ -25,7 +25,6 @@ import (
2525 "strings"
2626 "testing"
2727
28- "github.com/go-git/go-git/v5"
2928 "github.com/google/go-cmp/cmp"
3029 "github.com/googleapis/librarian/internal/config"
3130 "github.com/googleapis/librarian/internal/github"
@@ -1337,11 +1336,8 @@ func TestCommitAndPush(t *testing.T) {
13371336 Name : "origin" ,
13381337 URLs : []string {"https://github.com/googleapis/librarian.git" },
13391338 }
1340- status := make (git.Status )
1341- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
13421339 return & MockRepository {
13431340 Dir : t .TempDir (),
1344- AddAllStatus : status ,
13451341 RemotesValue : []* gitrepo.Remote {remote },
13461342 }
13471343 },
@@ -1368,11 +1364,8 @@ func TestCommitAndPush(t *testing.T) {
13681364 Name : "origin" ,
13691365 URLs : []string {"https://github.com/googleapis/librarian.git" },
13701366 }
1371- status := make (git.Status )
1372- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
13731367 return & MockRepository {
13741368 Dir : t .TempDir (),
1375- AddAllStatus : status ,
13761369 RemotesValue : []* gitrepo.Remote {remote },
13771370 }
13781371 },
@@ -1392,11 +1385,8 @@ func TestCommitAndPush(t *testing.T) {
13921385 Name : "origin" ,
13931386 URLs : []string {"https://github.com/googleapis/librarian.git" },
13941387 }
1395- status := make (git.Status )
1396- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
13971388 return & MockRepository {
13981389 Dir : t .TempDir (),
1399- AddAllStatus : status ,
14001390 RemotesValue : []* gitrepo.Remote {remote },
14011391 }
14021392 },
@@ -1412,11 +1402,8 @@ func TestCommitAndPush(t *testing.T) {
14121402 {
14131403 name : "No GitHub Remote" ,
14141404 setupMockRepo : func (t * testing.T ) gitrepo.Repository {
1415- status := make (git.Status )
1416- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
14171405 return & MockRepository {
14181406 Dir : t .TempDir (),
1419- AddAllStatus : status ,
14201407 RemotesValue : []* gitrepo.Remote {}, // No remotes
14211408 }
14221409 },
@@ -1457,12 +1444,8 @@ func TestCommitAndPush(t *testing.T) {
14571444 Name : "origin" ,
14581445 URLs : []string {"https://github.com/googleapis/librarian.git" },
14591446 }
1460-
1461- status := make (git.Status )
1462- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
14631447 return & MockRepository {
14641448 Dir : t .TempDir (),
1465- AddAllStatus : status ,
14661449 RemotesValue : []* gitrepo.Remote {remote },
14671450 CreateBranchAndCheckoutError : errors .New ("create branch error" ),
14681451 }
@@ -1482,12 +1465,8 @@ func TestCommitAndPush(t *testing.T) {
14821465 Name : "origin" ,
14831466 URLs : []string {"https://github.com/googleapis/librarian.git" },
14841467 }
1485-
1486- status := make (git.Status )
1487- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
14881468 return & MockRepository {
14891469 Dir : t .TempDir (),
1490- AddAllStatus : status ,
14911470 RemotesValue : []* gitrepo.Remote {remote },
14921471 CommitError : errors .New ("commit error" ),
14931472 }
@@ -1507,12 +1486,8 @@ func TestCommitAndPush(t *testing.T) {
15071486 Name : "origin" ,
15081487 URLs : []string {"https://github.com/googleapis/librarian.git" },
15091488 }
1510-
1511- status := make (git.Status )
1512- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
15131489 return & MockRepository {
15141490 Dir : t .TempDir (),
1515- AddAllStatus : status ,
15161491 RemotesValue : []* gitrepo.Remote {remote },
15171492 PushError : errors .New ("push error" ),
15181493 }
@@ -1532,12 +1507,8 @@ func TestCommitAndPush(t *testing.T) {
15321507 Name : "origin" ,
15331508 URLs : []string {"https://github.com/googleapis/librarian.git" },
15341509 }
1535-
1536- status := make (git.Status )
1537- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
15381510 return & MockRepository {
15391511 Dir : t .TempDir (),
1540- AddAllStatus : status ,
15411512 RemotesValue : []* gitrepo.Remote {remote },
15421513 }
15431514 },
@@ -1557,12 +1528,8 @@ func TestCommitAndPush(t *testing.T) {
15571528 Name : "origin" ,
15581529 URLs : []string {"https://github.com/googleapis/librarian.git" },
15591530 }
1560-
1561- status := make (git.Status )
1562- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
15631531 return & MockRepository {
15641532 Dir : t .TempDir (),
1565- AddAllStatus : status ,
15661533 RemotesValue : []* gitrepo.Remote {remote },
15671534 }
15681535 },
@@ -1586,7 +1553,7 @@ func TestCommitAndPush(t *testing.T) {
15861553 }
15871554 return & MockRepository {
15881555 Dir : t .TempDir (),
1589- AddAllStatus : git. Status {}, // Clean status
1556+ IsCleanValue : true ,
15901557 RemotesValue : []* gitrepo.Remote {remote },
15911558 }
15921559 },
@@ -1603,11 +1570,8 @@ func TestCommitAndPush(t *testing.T) {
16031570 Name : "origin" ,
16041571 URLs : []string {"https://github.com/googleapis/librarian.git" },
16051572 }
1606- status := make (git.Status )
1607- status ["file.txt" ] = & git.FileStatus {Worktree : git .Modified }
16081573 return & MockRepository {
16091574 Dir : t .TempDir (),
1610- AddAllStatus : status ,
16111575 RemotesValue : []* gitrepo.Remote {remote },
16121576 }
16131577 },
0 commit comments