Skip to content

Commit

Permalink
allow --continue without providing initialBranch
Browse files Browse the repository at this point in the history
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
  • Loading branch information
kiprasmel committed Jun 7, 2022
1 parent efdc4cf commit 2a6827b
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion git-stacked-rebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ git-stacked-rebase <branch> [-a|--apply]
2. but wil not push the partial branches to a remote until --push --force is used.
git-stacked-rebase <branch> [-c|--continue]
git-stacked-rebase [<branch>] (-c|--continue)
(!) should be used instead of git-rebase's --continue
Expand Down Expand Up @@ -1475,6 +1475,31 @@ git-stacked-rebase ${gitStackedRebaseVersionStr} __BUILD_DATE_REPLACEMENT_STR__
throw new Termination(helpMsg);
}

if (["--continue", "-c"].includes(nameOfInitialBranch) && !process.argv.length) {
console.log("--continue without initialBranch");

/**
* TODO allow `null` / make optional
*
* both will need some intellisense to only allow
* in specific cases
*
* (unless we'll keep track of the
* current initial branch we're working with?)
*
*/
const initialBranch = "";

/**
* TODO call more appropraitely / extract default options
* so that it's less error-prone here
*/
return gitStackedRebase(initialBranch, {
gitDir,
continue: true,
});
}

/**
* TODO: improve arg parsing, lmao
*/
Expand Down

0 comments on commit 2a6827b

Please sign in to comment.