Skip to content

Commit b2c3350

Browse files
Copilotkwin
andcommitted
Fix host field handling to write only one host line
Co-authored-by: kwin <[email protected]>
1 parent 6b388f8 commit b2c3350

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/codehaus/plexus/components/secdispatcher/internal/sources/GitCredentialHelperMasterSource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ private String retrievePassword(String helperName, String url) throws IOExceptio
194194
writer.println("protocol=" + uri.getScheme());
195195
}
196196
if (uri.getHost() != null && !uri.getHost().isEmpty()) {
197-
writer.println("host=" + uri.getHost());
198197
if (uri.getPort() != -1) {
199198
writer.println("host=" + uri.getHost() + ":" + uri.getPort());
199+
} else {
200+
writer.println("host=" + uri.getHost());
200201
}
201202
}
202203
if (uri.getPath() != null && !uri.getPath().isEmpty()) {

0 commit comments

Comments
 (0)