public Task FetchAsync(GitShowRevisionArguments arguments)
 {
     try
     {
         return(runCommandAndCacheResultAsync(arguments, _cachedRevisions));
     }
     catch (GitCommandServiceInternalException ex)
     {
         ExceptionHandlers.Handle(ex.Message, ex);
         throw new FetchFailedException(ex);
     }
 }
 public IEnumerable <string> ShowRevision(GitShowRevisionArguments arguments)
 {
     try
     {
         return(runCommandAndCacheResult(arguments, _cachedRevisions));
     }
     catch (GitCommandServiceInternalException ex)
     {
         ExceptionHandlers.Handle(ex.Message, ex);
         throw new GitNotAvailableDataException(ex);
     }
 }
Esempio n. 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);
            }
        }
 abstract protected Task <object> runCommandAsync(GitShowRevisionArguments arguments);
 abstract protected object runCommand(GitShowRevisionArguments arguments);
 protected override Task <object> runCommandAsync(GitShowRevisionArguments arguments)
 {
     return(Task.FromResult <object>(runCommand(arguments)));
 }
 async protected override Task <object> runCommandAsync(GitShowRevisionArguments arguments)
 {
     return((await startExternalProcessAsync("git", arguments.ToString(), _path, null)).StdOut);
 }
 protected override object runCommand(GitShowRevisionArguments arguments)
 {
     return(startExternalProcess("git", arguments.ToString(), _path, true, null).StdOut);
 }