File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 77 "os"
88 "os/exec"
99 "path/filepath"
10+ "strings"
1011 "testing"
1112)
1213
@@ -295,14 +296,16 @@ func TestGitGetter_submodule(t *testing.T) {
295296}
296297
297298func TestGitGetter_setupGitEnv_sshKey (t * testing.T ) {
298- cmd := exec .Command ("/bin/sh" , "-c" , "echo -n $GIT_SSH_COMMAND" )
299+ cmd := exec .Command ("/bin/sh" , "-c" , "echo $GIT_SSH_COMMAND" )
299300 setupGitEnv (cmd , "/tmp/foo.pem" )
300301 out , err := cmd .Output ()
301302 if err != nil {
302303 t .Fatal (err )
303304 }
304- if string (out ) != "ssh -i /tmp/foo.pem" {
305- t .Fatalf ("unexpected GIT_SSH_COMMAND: %q" , string (out ))
305+
306+ actual := strings .TrimSpace (string (out ))
307+ if actual != "ssh -i /tmp/foo.pem" {
308+ t .Fatalf ("unexpected GIT_SSH_COMMAND: %q" , actual )
306309 }
307310}
308311
You can’t perform that action at this time.
0 commit comments