コード例 #1
0
 public Task FetchAsync(GitShowRevisionArguments arguments)
 {
     try
     {
         return(runCommandAndCacheResultAsync(arguments, _cachedRevisions));
     }
     catch (GitCommandServiceInternalException ex)
     {
         ExceptionHandlers.Handle(ex.Message, ex);
         throw new FetchFailedException(ex);
     }
 }
コード例 #2
0
 public IEnumerable <string> ShowRevision(GitShowRevisionArguments arguments)
 {
     try
     {
         return(runCommandAndCacheResult(arguments, _cachedRevisions));
     }
     catch (GitCommandServiceInternalException ex)
     {
         ExceptionHandlers.Handle(ex.Message, ex);
         throw new GitNotAvailableDataException(ex);
     }
 }
コード例 #3
0
        protected override object runCommand(GitShowRevisionArguments arguments)
        {
            FileRevision fileRevision     = new FileRevision(arguments.Filename, arguments.Sha);
            string       fileRevisionPath = _fileCache.GetFileRevisionPath(fileRevision);

            try
            {
                string content = System.IO.File.ReadAllText(fileRevisionPath);
                return(StringUtils.ConvertNewlineWindowsToUnix(content).Split('\n'));
            }
            catch (Exception ex)
            {
                throw new GitCommandServiceInternalException(ex);
            }
        }
コード例 #4
0
 abstract protected Task <object> runCommandAsync(GitShowRevisionArguments arguments);
コード例 #5
0
 abstract protected object runCommand(GitShowRevisionArguments arguments);
コード例 #6
0
 protected override Task <object> runCommandAsync(GitShowRevisionArguments arguments)
 {
     return(Task.FromResult <object>(runCommand(arguments)));
 }
コード例 #7
0
 async protected override Task <object> runCommandAsync(GitShowRevisionArguments arguments)
 {
     return((await startExternalProcessAsync("git", arguments.ToString(), _path, null)).StdOut);
 }
コード例 #8
0
 protected override object runCommand(GitShowRevisionArguments arguments)
 {
     return(startExternalProcess("git", arguments.ToString(), _path, true, null).StdOut);
 }