Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): skip unused default-branch lookups #19825

MergedIfkumRfnl(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/19825/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 72 additions and 12 deletions.

x
0 of 2 viewed, 2 left
54 additions and 3 deletionsapps/server/src/vcs/GitVcsDriverCore.test.tsModified
View file
@@ -2963,6 +2963,27 @@
aheadOfDefaultCount: 0,
+​
+ yield* git(cwd, ["branch", "-f", initialBranch, "HEAD"]);
+ yield* git(cwd, ["update-ref", "refs/remotes/origin/trunk", "HEAD"]);
+ yield* git(cwd, ["symbolic-ref", "refs/remotes/origin/HEAD", "refs/remotes/origin/trunk"]);
+ for (const base of [initialBranch, "missing-base"]) {
+ yield* git(cwd, ["config", "branch.feature/local-only.gh-merge-base", base]);
+ commands.length = 0;
+ const status = yield* driver.statusDetailsLocal(cwd, {
+ includeDivergence: false,
+ includeBranchChanges: true,
+ });
+ assert.deepEqual(status.branchChanges, {
+ baseRef: `origin/${base === initialBranch ? initialBranch : "trunk"}`,
+ insertions: base === initialBranch ? 3 : 2,
+ deletions: 0,
+ });
+ assert.lengthOf(
+ commands.filter((args) => args.join(" ") === "symbolic-ref refs/remotes/origin/HEAD"),
+ base === initialBranch ? 0 : 1,
+ );
+ }
@@ -2970,27 +2991,57 @@