0

I am using a AzureDevopsGit api call to check if a branch exists inside a repository. It throws a 200 status code irrespective.

For eg: If a branch exists (master): Response code : 200 and expected json response.

If a branch does not exist (BLAH): response code 200 and the JSON response as follows

URL https://dev.azure.com/{organisation}/{project}/_apis/git/repositories/BaseSW-Lib-Tools/refs?filter=heads/BLAH

Image: Response

Is it not wrong to have 200 status code on a branch that does not exist?

RCB
  • 479
  • 1
  • 9

1 Answers1

0

This is actually a list endpoint with a filter. There does not appear to be a specific "get branch by name" endpoint available.

Given that, a 200 response with zero results would be what I would expect to see.

Derek Gusoff
  • 780
  • 4
  • 6