[GIT] Fix `GetBranch` To Support Full Branch Reference (#820)

rkapoor10-patch-1
Johannes Batzill 2023-11-22 20:20:03 +00:00 committed by Harness
parent 4e949a2d9f
commit e162112a29
1 changed files with 2 additions and 1 deletions

View File

@ -176,8 +176,9 @@ func (s *Service) GetBranch(ctx context.Context, params *GetBranchParams) (*GetB
}
repoPath := getFullPathForRepo(s.reposRoot, params.RepoUID)
sanitizedBranchName := strings.TrimPrefix(params.BranchName, gitReferenceNamePrefixBranch)
gitBranch, err := s.adapter.GetBranch(ctx, repoPath, params.BranchName)
gitBranch, err := s.adapter.GetBranch(ctx, repoPath, sanitizedBranchName)
if err != nil {
return nil, err
}