Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit 752fe5b

Browse files
Respect the target branch on a local DevOps pipeline (#1139)
Co-authored-by: Martin Demberger <[email protected]>
1 parent 10ad530 commit 752fe5b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

NuKeeper.AzureDevOps/AzureDevOpsSettingsReader.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ private static RepositorySettings CreateSettingsFromRemote(Uri repositoryUri, st
9797

9898
private async Task<RepositorySettings> CreateSettingsFromLocal(Uri repositoryUri, string targetBranch)
9999
{
100-
var remoteInfo = new RemoteInfo();
100+
var remoteInfo = new RemoteInfo()
101+
{
102+
BranchName = targetBranch,
103+
};
101104

102105
var localCopy = repositoryUri;
103106
if (await _gitDriver.IsGitRepo(repositoryUri))
@@ -138,7 +141,8 @@ private async Task<RepositorySettings> CreateSettingsFromLocal(Uri repositoryUri
138141
pathParts[0], //org
139142
repositoryUri, //uri
140143
Uri.UnescapeDataString(pathParts[1]), // project
141-
Uri.UnescapeDataString(pathParts[3]) // reponame
144+
Uri.UnescapeDataString(pathParts[3]), // reponame
145+
remoteInfo
142146
);
143147
}
144148
else if (indexOfGit == 1 && pathParts.Length == 3)
@@ -147,7 +151,8 @@ private async Task<RepositorySettings> CreateSettingsFromLocal(Uri repositoryUri
147151
null, //org
148152
repositoryUri, //uri
149153
Uri.UnescapeDataString(pathParts[0]), // project
150-
Uri.UnescapeDataString(pathParts[2]) // reponame
154+
Uri.UnescapeDataString(pathParts[2]), // reponame
155+
remoteInfo
151156
);
152157
}
153158
return null;

0 commit comments

Comments
 (0)