private static IPreCommit[] FetchHooks(IKernel kernel) { ArrayList list = new ArrayList(); foreach (IHandler handler in kernel.GetHandlers(typeof(IPreCommit))) { IPreCommit hook = (IPreCommit)handler.Resolve(); list.Add(hook); } return((IPreCommit[])list.ToArray(typeof(IPreCommit))); }
private static bool HooksAllow(RepositoryFile file, IPreCommit[] hooks) { bool hooksOK = true; foreach (IPreCommit hook in hooks) { Error[] errors = hook.PreCommit(file); if(errors != null && errors.Length > 0) { hooksOK = false; Console.Error.WriteLine("An error occured in \"{0}\"", file); foreach(Error error in errors) { Console.Error.WriteLine(error.Description); } } } return hooksOK; }
[TestFixtureSetUp] public void FixtureSetUp() { hook = new PreCommitEolStyle("cs"); }
[TestFixtureSetUp] public void FixtureSetUp() { hook = new PreCommitSourceHeader("cs"); }