Beispiel #1
0
        private bool TryGetCommitLog([NotNull] string commitId, [NotNull] string format, out string error, out string data)
        {
            if (commitId.IsArtificial())
            {
                data  = null;
                error = "No log information for artificial commits";
                return(false);
            }

            var arguments = new GitArgumentBuilder("log")
            {
                "-1",
                $"--pretty=\"format:{format}\"",
                commitId
            };

            // Do not cache this command, since notes can be added
            data = GetModule().GitExecutable.GetOutput(arguments, outputEncoding: VsrModule.LosslessEncoding);

            if (VsrModule.IsGitErrorMessage(data))
            {
                error = "Cannot find commit " + commitId;
                return(false);
            }

            error = null;
            return(true);
        }