Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1x 3x 8x 1x 1x | import { git } from "../../shared/adapters/git.ts";
/** Reuse an existing issue branch so checkout does not fail on a duplicate ref. */
export const branchForIssue = (issue: number): string | undefined =>
git("branch", "--format=%(refname:short)")
.split("\n")
.find((name) => new RegExp(`^[^/]+/[^/]+/${issue}-`).test(name));
export const checkout = (branch: string): void => {
git("checkout", branch);
};
export const currentBranch = (): string => git("rev-parse", "--abbrev-ref", "HEAD");
|