Skip to content

Commit 0893a72

Browse files
committed
tools: support v doctor -skip-github to fully skip the fetching step, in places that have limited connectivity (alternative fix/workaround for #23955)
1 parent 9a8961f commit 0893a72

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/tools/vdoctor.v

+3-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ fn (mut a App) cpu_info(key string) string {
263263
fn (mut a App) git_info() string {
264264
mut out := a.cmd(command: 'git -C . describe --abbrev=8 --dirty --always --tags').trim_space()
265265
os.execute('git -C . remote add V_REPO https://github.com/vlang/v') // ignore failure (i.e. remote exists)
266-
os.execute('${os.quoted_path(a.vexe)} timeout 5.1 "git -C . fetch V_REPO"') // usually takes ~0.6s; 5 seconds should be enough for even the slowest networks
266+
if '-skip-github' !in os.args {
267+
os.execute('${os.quoted_path(a.vexe)} timeout 5.1 "git -C . fetch V_REPO"') // usually takes ~0.6s; 5 seconds should be enough for even the slowest networks
268+
}
267269
commit_count := a.cmd(command: 'git rev-list @{0}...V_REPO/master --right-only --count').int()
268270
if commit_count > 0 {
269271
out += ' (${commit_count} commit(s) behind V master)'

0 commit comments

Comments
 (0)