Example #1
0
 /// <inheritdoc/>
 public void CheckoutLatestCommitForSpecificFile(string org, string repository, string fileName)
 {
     try
     {
         _decoratedService.CheckoutLatestCommitForSpecificFile(org, repository, fileName);
     }
     catch (Exception ex)
     {
         LogError(ex, "CheckoutLatestCommitForSpecificFile", org, repository);
         throw;
     }
 }
Example #2
0
        public ActionResult DiscardLocalChangesForSpecificFile(string org, string repository, string fileName)
        {
            try
            {
                if (string.IsNullOrEmpty(org) || string.IsNullOrEmpty(repository) || string.IsNullOrEmpty(fileName))
                {
                    return(ValidationProblem("One or all of the input parameters are null"));
                }

                _sourceControl.CheckoutLatestCommitForSpecificFile(org, repository, fileName);
                return(Ok());
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Example #3
0
        public ActionResult <HttpResponseMessage> DiscardLocalChangesForSpecificFile(string owner, string repository, string fileName)
        {
            try
            {
                if (string.IsNullOrEmpty(owner) || string.IsNullOrEmpty(repository) || string.IsNullOrEmpty(fileName))
                {
                    HttpResponseMessage badRequest = new HttpResponseMessage(HttpStatusCode.BadRequest);
                    badRequest.ReasonPhrase = "One or all of the input parameters are null";
                    return(badRequest);
                }

                _sourceControl.CheckoutLatestCommitForSpecificFile(owner, repository, fileName);
                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
            catch (Exception ex)
            {
                return(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
        }