@shivanshshrivas/gwit 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. package/dist/index.cjs +7 -0
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -210,6 +210,9 @@ function branchExistsRemote(branch) {
210
210
  const result = runArgsSafe("git", ["ls-remote", "--heads", "origin", branch]);
211
211
  return result.success && result.stdout.length > 0;
212
212
  }
213
+ function fetchOrigin() {
214
+ runArgsInherited("git", ["fetch", "origin"]);
215
+ }
213
216
  function addWorktree(worktreePath, branch, isNew) {
214
217
  const args = isNew ? ["worktree", "add", "-b", branch, worktreePath] : ["worktree", "add", worktreePath, branch];
215
218
  runArgsInherited("git", args);
@@ -624,6 +627,10 @@ async function createCommand(branch, options) {
624
627
  );
625
628
  }
626
629
  assertBranchResolvable(branch, isNew);
630
+ if (!isNew && !branchExistsLocal(branch)) {
631
+ ui.step("Fetching from origin\u2026");
632
+ fetchOrigin();
633
+ }
627
634
  const config = await ensureConfig();
628
635
  const mainPath = getMainWorktreePath();
629
636
  const slug = toSlug(branch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivanshshrivas/gwit",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Fully isolated git worktrees for parallel development",
5
5
  "license": "MIT",
6
6
  "engines": {