Skip to content

Commit

Permalink
[fix]: [PL-24880]: Trim the ref when fetching default branch in get R…
Browse files Browse the repository at this point in the history
…epo API (#172)

* [fix]: [PL-24880]: Trim the ref when fetching default branch
  • Loading branch information
DeepakPatankar authored Apr 29, 2022
1 parent 7539f6d commit c98fdb3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scm/driver/azure/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func convertRepository(from *repository) *scm.Repository {
ID: from.ID,
Name: from.Name,
Link: from.URL,
Branch: from.DefaultBranch,
Branch: scm.TrimRef(from.DefaultBranch),
}
}

Expand Down
2 changes: 1 addition & 1 deletion scm/driver/azure/testdata/repo.json.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ID": "91f0d4cb-4c36-49a5-b28d-2d72da089c4d",
"Name": "test_project",
"Branch": "refs/heads/main",
"Branch": "main",
"Link": "https://dev.azure.com/tphoney/d350c9c0-7749-4ff8-a78f-f9c1f0e56729/_apis/git/repositories/91f0d4cb-4c36-49a5-b28d-2d72da089c4d"
}
4 changes: 2 additions & 2 deletions scm/driver/azure/testdata/repos.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
"ID": "91f0d4cb-4c36-49a5-b28d-2d72da089c4d",
"Name": "test_project",
"Branch": "refs/heads/main",
"Branch": "main",
"Link": "https://dev.azure.com/tphoney/d350c9c0-7749-4ff8-a78f-f9c1f0e56729/_apis/git/repositories/91f0d4cb-4c36-49a5-b28d-2d72da089c4d"
},
{
"ID": "fde2d21f-13b9-4864-a995-83329045289a",
"Name": "test_repo2",
"Branch": "refs/heads/main",
"Branch": "main",
"Link": "https://dev.azure.com/tphoney/d350c9c0-7749-4ff8-a78f-f9c1f0e56729/_apis/git/repositories/fde2d21f-13b9-4864-a995-83329045289a"
}
]

0 comments on commit c98fdb3

Please sign in to comment.