Skip to content
Source
Sign inSign up
pingdotgg/t3code

Support remote branch listing and tracked checkout from branch picker #126

Mergedjuliusmarmingemerged 7 commits intomain fromcodething/deb940eemerged by juliusmarminge View on GitHub

Showing 8 changed files with 218 additions and 0 deletions (loading 7).

x
0 of 8 viewed, 8 left
218 additions and 0 deletionsapps/server/src/git/Layers/GitCore.test.tsModified
View file
@@ -266,6 +266,18 @@
}),
​
+ it.effect("does not include detached HEAD pseudo-refs as branches", () =>
+ Effect.gen(function* () {
+ const tmp = yield* makeTmpDir();
+ yield* initRepoWithCommit(tmp);
+ yield* git(tmp, ["checkout", "--detach", "HEAD"]);
+​
+ const result = yield* listGitBranches({ cwd: tmp });
+ expect(result.branches.some((branch) => branch.name.startsWith("("))).toBe(false);
+ expect(result.branches.some((branch) => branch.current)).toBe(false);
+ }),
+ );
+​
it.effect("keeps current branch first and sorts the remaining branches by recency", () =>
Effect.gen(function* () {
const tmp = yield* makeTmpDir();
@@ -370,6 +382,82 @@
expect(result.branches.every((b) => b.isDefault === false)).toBe(true);
}),
+​
+ it.effect("lists local branches first and remote branches last", () =>
+ Effect.gen(function* () {
+ const remote = yield* makeTmpDir();
+ const tmp = yield* makeTmpDir();
+​