public void HandleRenameBranchResult(RenameBranchParameters parameters, GitOutput output) { Assert.IsNotNull(parameters); Assert.IsNotNull(output); if(output.ExitCode != 0) { if(IsBranchAlreadyExistsError(output.Error, parameters.NewName)) { throw new BranchAlreadyExistsException(parameters.NewName); } if(IsInvalidBranchNameError(output.Error, parameters.NewName)) { throw new InvalidBranchNameException(parameters.NewName); } output.Throw(); } }
public Command GetRenameBranchCommand(RenameBranchParameters parameters) { Assert.IsNotNull(parameters); return new BranchCommand( parameters.Force ? BranchCommand.MoveForce() : BranchCommand.Move(), new CommandParameter(parameters.OldName), new CommandParameter(parameters.NewName)); }