Is it possible to create and test a new git branch from CakeBuild?

My question is in two parts

1) I need to create and test a new git branch through the cake assembly. In git, this would be exactly the same as we do

git branch Foo
git checkout Foo

The application Cake.Gitadds information about the current branch name, but I doubt that it has functionality for branching and validation.

2) The existing method GitCheckoutthrows an exception. There is an existing branch of ReleaseRCthis repo, but it throws an exception. What am I missing here?

Task("Checkout")
    .Does(() =>
{
    var repositoryPath = "../../.foo";

    Information(GitBranchCurrent(repositoryPath).FriendlyName); //Prints 'master'

    GitCheckout(repositoryPath, "ReleaseRC", new FilePath[] {}); //Throws error.
});

Error

+4
source share
1 answer

, Cake.Git. Cake.Git, :

https://github.com/cake-contrib/Cake_Git/issues/52

, git, StartProcess .

https://cakebuild.net/api/Cake.Common/ProcessAliases/81E648CC

:

var exitCodeWithArgument = StartProcess("git", new ProcessSettings{ Arguments = "branch foo" });

UPDATE. 0.18.0 Cake.Git GitCreateBranch .

+2

Source: https://habr.com/ru/post/1694752/


All Articles