@@ -39,7 +39,7 @@ func TestGetLastTag(t *testing.T) {
3939 Remote : "origin" ,
4040 Branch : "main" ,
4141 }
42- got , err := GetLastTag (t .Context (), cfg .GetExecutablePath ("git" ), cfg .Remote , cfg .Branch )
42+ got , err := GetLastTag (t .Context (), command .GetExecutablePath (cfg . Preinstalled , "git" ), cfg .Remote , cfg .Branch )
4343 if err != nil {
4444 t .Fatal (err )
4545 }
@@ -54,7 +54,7 @@ func TestLastTagGitError(t *testing.T) {
5454 Remote : "origin" ,
5555 Branch : "main" ,
5656 }
57- _ , err := GetLastTag (t .Context (), cfg .GetExecutablePath ("git" ), cfg .Remote , cfg .Branch )
57+ _ , err := GetLastTag (t .Context (), command .GetExecutablePath (cfg . Preinstalled , "git" ), cfg .Remote , cfg .Branch )
5858 if err == nil {
5959 t .Fatal ("expected an error but got none" )
6060 }
@@ -77,7 +77,7 @@ func TestIsNewFileSuccess(t *testing.T) {
7777 t .Fatal (err )
7878 }
7979 cfg := & config.Release {}
80- gitExe := cfg .GetExecutablePath ("git" )
80+ gitExe := command .GetExecutablePath (cfg . Preinstalled , "git" )
8181
8282 newName := path .Join ("src" , "storage" , "src" , "new.rs" )
8383 if err := os .MkdirAll (path .Dir (newName ), 0755 ); err != nil {
@@ -105,7 +105,7 @@ func TestIsNewFileDiffError(t *testing.T) {
105105 t .Chdir (t .TempDir ())
106106 testhelper .SetupForVersionBump (t , wantTag )
107107 cfg := & config.Release {}
108- gitExe := cfg .GetExecutablePath ("git" )
108+ gitExe := command .GetExecutablePath (cfg . Preinstalled , "git" )
109109 existingName := path .Join ("src" , "storage" , "src" , "lib.rs" )
110110 if IsNewFile (t .Context (), gitExe , "invalid-tag" , existingName ) {
111111 t .Errorf ("diff errors should return false for isNewFile(): %s" , existingName )
@@ -114,14 +114,10 @@ func TestIsNewFileDiffError(t *testing.T) {
114114
115115func TestFilesChangedSuccess (t * testing.T ) {
116116 const wantTag = "release-2001-02-03"
117- release := & config.Release {
118- Remote : "origin" ,
119- Branch : "main" ,
120- }
121117 remoteDir := testhelper .SetupRepoWithChange (t , wantTag )
122118 testhelper .CloneRepository (t , remoteDir )
123119
124- got , err := FilesChangedSince (t .Context (), wantTag , release .GetExecutablePath ("git" ), release . IgnoredChanges )
120+ got , err := FilesChangedSince (t .Context (), wantTag , command .GetExecutablePath (nil , "git" ), nil )
125121 if err != nil {
126122 t .Fatal (err )
127123 }
@@ -133,13 +129,9 @@ func TestFilesChangedSuccess(t *testing.T) {
133129
134130func TestFilesBadRef (t * testing.T ) {
135131 const wantTag = "release-2002-03-04"
136- release := & config.Release {
137- Remote : "origin" ,
138- Branch : "main" ,
139- }
140132 remoteDir := testhelper .SetupRepoWithChange (t , wantTag )
141133 testhelper .CloneRepository (t , remoteDir )
142- if got , err := FilesChangedSince (t .Context (), "--invalid--" , release .GetExecutablePath ("git" ), release . IgnoredChanges ); err == nil {
134+ if got , err := FilesChangedSince (t .Context (), "--invalid--" , command .GetExecutablePath (nil , "git" ), nil ); err == nil {
143135 t .Errorf ("expected an error with invalid tag, got=%v" , got )
144136 }
145137}
@@ -245,7 +237,7 @@ func TestAssertGitStatusClean(t *testing.T) {
245237 tmpDir := t .TempDir ()
246238 t .Chdir (tmpDir )
247239 test .setup (t )
248- err := AssertGitStatusClean (t .Context (), cfg .GetExecutablePath ("git" ))
240+ err := AssertGitStatusClean (t .Context (), command .GetExecutablePath (cfg . Preinstalled , "git" ))
249241 if (err != nil ) != test .wantErr {
250242 t .Errorf ("AssertGitStatusClean() error = %v, wantErr %v" , err , test .wantErr )
251243 }
0 commit comments