Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): branch PRs stay matched when a remote has a second push URL #29625

Mergedsaphid(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/29625/headmerged by maria-rcks View on GitHub

Showing 6 changed files with 124 additions and 8 deletions (loading 3).

x
0 of 6 viewed, 6 left
48 additions and 0 deletionsapps/server/src/git/GitManager.test.tsModified
View file
@@ -926,6 +926,54 @@
}),
​
+ it.effect("status reads a remote's first URL when it has a second push URL", () =>
+ Effect.gen(function* () {
+ const repoDir = yield* makeTempDir("t3code-git-manager-");
+ yield* initRepo(repoDir);
+ yield* runGit(repoDir, ["checkout", "-b", "feature/mirrored"]);
+ const remoteDir = yield* createBareRemote();
+ yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
+ yield* runGit(repoDir, ["push", "-u", "origin", "feature/mirrored"]);
+ yield* configureVisibleRemoteUrlWithLocalRewrite(
+ repoDir,
+ "origin",
+ "git@github.com:pingdotgg/codething-mvp.git",
+ remoteDir,
+ );
+ // `git remote set-url --add`: Git fetches from the first URL and also pushes to this one.
+ yield* runGit(repoDir, [
+ "config",
+ "--add",
+ "remote.origin.url",
+ "git@gitlab.com:mirror-owner/codething-mvp.git",
+ ]);
+​
+ const { manager } = yield* makeManager({
+ providerScenario: {
+ prListSequence: [
+ [