Quantcast
Channel: How to check whether a commit is present in a Branch in Azure Dev Ops? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

How to check whether a commit is present in a Branch in Azure Dev Ops?

$
0
0

I have a commit id, I want to check whether is it present in a branch or in which branches this commit id is present.

GitBranchStats doesn't have any properties related to commit info in

Microsoft.TeamFoundation.SourceControl.WebApi library.Uri orgUrl = new Uri("https://example.com");         // Organization URL            String personalAccessToken = "XXXXXXXXX"; VssConnection connection = new VssConnection(orgUrl, new VssBasicCredential(string.Empty, personalAccessToken));GitHttpClient gitClient = connection.GetClient<GitHttpClient>();GitBranchStats branch = gitClient.GetBranchAsync("repo", "name").Result;

FYI, I am not looking for a git command, I already know this.

Edit:

It's giving exceptions in method check_whether_present_in_branches in a few cases when a branch is in any folder like below.

Exception message:

TF401175:The version descriptor <Branch: Release > could not beresolved to a version in the repository

enter image description here


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images