private void ShowUser(bool isGlobal) { ConfigurationLevel level = isGlobal ? ConfigurationLevel.Global : ConfigurationLevel.Local; using Repository repo = new Repository(Environment.CurrentDirectory); ConfigurationEntry <string> emailEntry = repo.Config.Get <string>("user.email", level); if (emailEntry == null) { Log.Red($"{level.ToString()} user is not set."); return; } Log.Green($"The {level.ToString()} user is set to {emailEntry.Value}"); }
public static void ConfigureGitConfig( ConfigurationLevel level = ConfigurationLevel.Global, string file = null ) { var config = new Configuration( file, file, file ); LogManager.GetCurrentClassLogger().Info( "Installing failmerge driver to " + ( file ?? level.ToString() ) ); config.Set( "merge.failmerge.name", "fail merge driver", level ); config.Set( "merge.failmerge.driver", "false", level ); config.Set( "merge.failmerge.recursive", "binary", level ); }
public XDocument DeleteConfiguration(string key, ConfigurationLevel level) { XDocument xml = XDocument.Parse(XmlName.EmptyRoot); xml.Root.Add(new XElement(XmlName.Key, key)); xml.Root.Add(new XElement(XmlName.Level, level.ToString().ToUpperInvariant())); xml.Root.Add(new XElement(XmlName.LocalTransactionId, SessionManager.VolatileElements.LocalTransactionId.ToUpperString())); xml.Root.Add(new XElement(XmlName.DeferredTransactionId, SessionManager.VolatileElements.DeferredTransactionId.ToUpperString())); xml.Root.Add(new XElement(XmlName.DatabaseId, ConfigurationMapper.Instance.DatabaseId.ToUpperString())); this.ExecuteStoredProcedure(StoredProcedure.configuration_p_deleteConfiguration, false, xml); return(xml); }