Skip to content

Visual Studio Code, rebuilt in Rust

Rust

fix(port): repoint a Studio mirror's upstream link on every sync

rokarturfc6ad7bb23e9
diff --git a/port/tools/studio b/port/tools/studio
index 8e4d812a77c..40f116a4748 100755
--- a/port/tools/studio
+++ b/port/tools/studio
@@ -29,8 +29,9 @@ stale=$(mktemp)
trap 'rm -f "$stale" "$sync_lock"' EXIT
# A mirror without alternates still has the full .git of the old rsync copy: replace it with a light one.
# A mixed reset moves only the index, so file mtimes and the cargo build stay as they are.
-# A mirror of a tree without src/ (split, milestone 22) reads upstream from the Studio's 1.148.0 reference: upstream -> ~/Developer/vscode-ref-1.148.0.
-ssh studio "cd ~/$work/$name && bash -c 'test -f .git/objects/info/alternates || { rm -rf .git && git init -q && echo ~/$work/git.git/objects > .git/objects/info/alternates; }; git reset -q $head && git clean -fdq && { git cat-file -e HEAD:src 2>/dev/null || test -e upstream || ln -s ~/Developer/vscode-ref-1.148.0 upstream; } && git ls-files -m -z'" > "$stale"
+# A mirror of a tree without src/ (split, milestone 22) reads upstream from the Studio's 1.148.0 reference: upstream -> ~/Developer/vscode-ref-1.148.0,
+# repointed on every run: a mirror seeded from port-src-integrate or synced before the uplift links the 1.147.0 one.
+ssh studio "cd ~/$work/$name && bash -c 'test -f .git/objects/info/alternates || { rm -rf .git && git init -q && echo ~/$work/git.git/objects > .git/objects/info/alternates; }; git reset -q $head && git clean -fdq && { git cat-file -e HEAD:src 2>/dev/null || test -d upstream -a ! -L upstream || ln -sfn ~/Developer/vscode-ref-1.148.0 upstream; } && git ls-files -m -z'" > "$stale"
# Diff against HEAD, not the index: staged changes (a merge being resolved) must travel too.
# openrsync has no --ignore-missing-args: leave out files deleted here.
cat "$stale" <(git diff --name-only -z --diff-filter=d HEAD) <(git ls-files -o --exclude-standard -z) | sort -zu | { grep -zvxFf <(git -c core.quotepath=off diff --name-only --diff-filter=D HEAD) || true; } | rsync -az --from0 --files-from=- . "studio:$work/$name/"