mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-06-28 05:33:47 +00:00
feat(issue-77): handle multiple target branches (#78)
fix: https://github.com/kiegroup/git-backporting/issues/77 This enhancement allow users to backport the same change to multiple branches with one single tool invocation
This commit is contained in:
parent
c19a56a9ad
commit
5fc72e127b
25 changed files with 1774 additions and 234 deletions
|
@ -114,4 +114,13 @@ describe("git cli service", () => {
|
|||
const output = spawnSync("git", ["cherry", "-v"], { cwd }).stdout.toString();
|
||||
expect(output.includes(expressionToTest)).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
test("git clone on already created repo", async () => {
|
||||
await git.clone("remote", cwd, "tbranch");
|
||||
|
||||
// use rev-parse to double check the current branch is the expected one
|
||||
const post = spawnSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], { cwd }).stdout.toString().trim();
|
||||
expect(post).toEqual("tbranch");
|
||||
});
|
||||
});
|
|
@ -1,7 +1,7 @@
|
|||
import GitClientFactory from "@bp/service/git/git-client-factory";
|
||||
import { GitPullRequest, GitClientType } from "@bp/service/git/git.types";
|
||||
import GitHubClient from "@bp/service/git/github/github-client";
|
||||
import { mergedPullRequestFixture, repo, targetOwner } from "../../../support/mock/github-data";
|
||||
import { MERGED_PR_FIXTURE, REPO, TARGET_OWNER } from "../../../support/mock/github-data";
|
||||
import { mockGitHubClient } from "../../../support/mock/git-client-mock-support";
|
||||
|
||||
describe("github service", () => {
|
||||
|
@ -22,7 +22,7 @@ describe("github service", () => {
|
|||
});
|
||||
|
||||
test("get pull request: success", async () => {
|
||||
const res: GitPullRequest = await gitClient.getPullRequest(targetOwner, repo, mergedPullRequestFixture.number);
|
||||
const res: GitPullRequest = await gitClient.getPullRequest(TARGET_OWNER, REPO, MERGED_PR_FIXTURE.number);
|
||||
expect(res.sourceRepo).toEqual({
|
||||
owner: "fork",
|
||||
project: "reponame",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue