Skip to content

Commit 2d7da57

Browse files
committed
don't prompt interactively for clone credentials
1 parent c3aaf5e commit 2d7da57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/git/repo.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ func CloneWithArgs(ctx context.Context, from, to string, args []string, opts Clo
147147
opts.Timeout = -1
148148
}
149149

150-
_, err = cmd.RunTimeout(opts.Timeout)
150+
env := []string{
151+
"GIT_TERMINAL_PROMPT=0", // avoid prompting for credentials interactively, supported since git v2.3
152+
}
153+
154+
_, err = cmd.RunInDirTimeoutEnv(env, opts.Timeout, "")
151155
return err
152156
}
153157

0 commit comments

Comments
 (0)