Esempio n. 1
0
        private string UpstreamBranchCanonicalNameFromLocalBranch()
        {
            ConfigurationEntry <string> mergeRefEntry = repo.Config.Get <string>("branch", FriendlyName, "merge");

            if (mergeRefEntry == null)
            {
                return(null);
            }

            return(mergeRefEntry.Value);
        }
Esempio n. 2
0
        private string RemoteNameFromLocalBranch()
        {
            ConfigurationEntry <string> remoteEntry = repo.Config.Get <string>("branch", FriendlyName, "remote");

            if (remoteEntry == null)
            {
                return(null);
            }

            string remoteName = remoteEntry.Value;

            if (string.IsNullOrEmpty(remoteName) ||
                string.Equals(remoteName, ".", StringComparison.Ordinal))
            {
                return(null);
            }

            return(remoteName);
        }
Esempio n. 3
0
 private static T ValueOrDefault <T>(ConfigurationEntry <T> value, T defaultValue)
 {
     return(value == null ? defaultValue : value.Value);
 }