GitCommands.GitCommands.GetFetchArgs C# (CSharp) Method

GetFetchArgs() private static method

private static GetFetchArgs ( string remote, string remoteBranch, string localBranch ) : string
remote string
remoteBranch string
localBranch string
return string
        private static string GetFetchArgs(string remote, string remoteBranch, string localBranch)
        {
            remote = FixPath(remote);

            //Remove spaces...
            if (remoteBranch != null)
                remoteBranch = remoteBranch.Replace(" ", "");
            if (localBranch != null)
                localBranch = localBranch.Replace(" ", "");

            string remoteBranchArguments;

            if (string.IsNullOrEmpty(remoteBranch))
                remoteBranchArguments = "";
            else
                remoteBranchArguments = "+refs/heads/" + remoteBranch + "";

            string localBranchArguments;
            var remoteUrl = GetSetting("remote." + remote + ".url");

            if (PathIsUrl(remote) && !string.IsNullOrEmpty(localBranch) && string.IsNullOrEmpty(remoteUrl))
                localBranchArguments = ":refs/heads/" + localBranch + "";
            else if (string.IsNullOrEmpty(localBranch) || PathIsUrl(remote) || string.IsNullOrEmpty(remoteUrl))
                localBranchArguments = "";
            else
                localBranchArguments = ":" + "refs/remotes/" + remote.Trim() + "/" + localBranch + "";

            var progressOption = "";
            if (VersionInUse.FetchCanAskForProgress)
                progressOption = "--progress ";

            return progressOption + "\"" + remote.Trim() + "\" " + remoteBranchArguments + localBranchArguments;
        }
GitCommands