From 671f59c570a2085798f3a7bcc0e75a691bb43c83 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 2 May 2024 15:21:21 +0300 Subject: [PATCH] tools: exclude thirdparty/tcc from the git clean operation, that vup does in case of a missing .git folder --- cmd/tools/vup.v | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/tools/vup.v b/cmd/tools/vup.v index 692fa1b39f..e1f64b9763 100644 --- a/cmd/tools/vup.v +++ b/cmd/tools/vup.v @@ -66,12 +66,15 @@ fn (app App) vprintln(s string) { fn (app App) update_from_master() { app.vprintln('> updating from master ...') if !os.exists('.git') { - // initialize as if it had been cloned + // initialize the folder, as if it had been cloned: app.git_command('git init') app.git_command('git remote add origin https://github.com/vlang/v') + app.git_command('git remote set-head origin master') app.git_command('git fetch') app.git_command('git reset --hard origin/master') - app.git_command('git clean -xdf --exclude v --exclude v.exe --exclude cmd/tools/vup --exclude cmd/tools/vup.exe') + // Note: in the .zip files, thirdparty/tcc/.git is missing to save space. + // -> Git clean below will try to remove thirdparty/tcc/ too, if it is not excluded specifically: + app.git_command('git clean -xfd --exclude thirdparty/tcc --exclude v --exclude v.exe --exclude cmd/tools/vup --exclude cmd/tools/vup.exe .') } else { // pull latest app.git_command('git pull https://github.com/vlang/v master')