Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): ignore tags during remote fetch #7619

ClosedClayMav(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7619/headopened View on GitHub

Showing 2 changed files with 43 additions and 1 deletion.

x
0 of 2 viewed, 2 left
42 additions and 0 deletionsapps/server/src/vcs/GitVcsDriverCore.test.tsModified
View file
@@ -1502,6 +1502,48 @@
describe("remote operations", () => {
+ it.effect("fetches remote branches without updating tags", () =>
+ Effect.gen(function* () {
+ const cwd = yield* makeTmpDir();
+ const remote = yield* makeTmpDir("git-remote-");
+ const peer = yield* makeTmpDir("git-peer-");
+ const { initialBranch } = yield* initRepoWithCommit(cwd);
+ yield* git(remote, ["init", "--bare"]);
+ yield* git(cwd, ["remote", "add", "origin", remote]);
+ yield* git(cwd, ["push", "-u", "origin", initialBranch]);
+ yield* git(cwd, ["tag", "release"]);
+ yield* git(cwd, ["push", "origin", "refs/tags/release"]);
+ yield* git(remote, ["symbolic-ref", "HEAD", `refs/heads/${initialBranch}`]);
+ const localTagCommit = yield* git(cwd, ["rev-parse", "refs/tags/release"]);
+​
+ yield* git(peer, ["clone", remote, "."]);
+ yield* git(peer, ["config", "user.email", "test@test.com"]);
+ yield* git(peer, ["config", "user.name", "Test"]);
+ yield* writeTextFile(peer, "remote-change.txt", "remote\n");
+ yield* git(peer, ["add", "remote-change.txt"]);
+ yield* git(peer, ["commit", "-m", "remote change"]);
+ yield* git(peer, ["push", "origin", initialBranch]);
+ yield* git(peer, ["tag", "--force", "release"]);
+ yield* git(peer, ["push", "--force", "origin", "refs/tags/release"]);
+ const remoteHead = yield* git(peer, ["rev-parse", "HEAD"]);
+ assert.notEqual(localTagCommit, remoteHead);
+​