예제 #1
0
        private int Execute(string url)
        {
            if (!Uri.TryCreate(url, UriKind.Absolute, out _))
            {
                Console.Error.WriteLine("error: URL is invalid");
                return(-1);
            }

            try
            {
                _git.SetConfig("policy.url", url, GitConfigurationScope.Global);
                return(0);
            }
            catch (GitException ex)
            {
                Console.Error.WriteLine("error: failed to initialize git-policy: {0} (exit={1})",
                                        ex.Message, ex.ExitCode);
                return(-1);
            }
        }