예제 #1
0
        public override IEnumerable <string> CollectArguments()
        {
            if (LocalChanges == LocalChangesAction.Merge)
            {
                yield return("--merge");
            }
            else if (LocalChanges == LocalChangesAction.Reset)
            {
                yield return("--force");
            }

            if (Remote)
            {
                if (NewBranchAction == NewBranch.Create)
                {
                    yield return("-b " + NewBranchName.Quote());
                }
                else if (NewBranchAction == NewBranch.Reset)
                {
                    yield return("-B " + NewBranchName.Quote());
                }
            }

            yield return(BranchName.QuoteNE());
        }
 protected override ArgumentString BuildArguments()
 {
     return(new GitArgumentBuilder("checkout")
     {
         { LocalChanges == LocalChangesAction.Merge, "--merge" },
         { LocalChanges == LocalChangesAction.Reset, "--force" },
         { Remote&& NewBranchMode == CheckoutNewBranchMode.Create, $"-b {NewBranchName.Quote()}" },
         { Remote&& NewBranchMode == CheckoutNewBranchMode.Reset, $"-B {NewBranchName.Quote()}" },
         BranchName.QuoteNE()
     });
 }