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

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

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