offsite 0.0.25 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2602,11 +2602,12 @@ async function fetchProject(cwd) {
2602
2602
  }
2603
2603
  }));
2604
2604
  }
2605
- async function localBranches(cwd) {
2605
+ async function listBranches(cwd, remote) {
2606
2606
  return (await git(cwd, [
2607
- "branch",
2607
+ "for-each-ref",
2608
2608
  "--sort=-committerdate",
2609
- "--format=%(refname:short)"
2609
+ "--format=%(if)%(symref)%(then)%(else)%(refname:short)%(end)",
2610
+ remote ? "refs/remotes" : "refs/heads"
2610
2611
  ])).stdout.split("\n").filter(Boolean);
2611
2612
  }
2612
2613
  async function switchBranch(cwd, branch, create) {
@@ -6278,7 +6279,8 @@ const handlers = {
6278
6279
  return null;
6279
6280
  },
6280
6281
  "git.branches": (params) => pullRequestBranches(path.join(projectPath(params.projectId), params.repo)),
6281
- "git.localBranches": (params) => localBranches(path.join(projectPath(params.projectId), params.repo)),
6282
+ "git.localBranches": (params) => listBranches(path.join(projectPath(params.projectId), params.repo), false),
6283
+ "git.remoteBranches": (params) => listBranches(path.join(projectPath(params.projectId), params.repo), true),
6282
6284
  "git.switch": async (params) => {
6283
6285
  await switchBranch(path.join(projectPath(params.projectId), params.repo), params.branch, params.create);
6284
6286
  return null;