lgoldstein commented on code in PR #430:
URL: https://github.com/apache/mina-sshd/pull/430#discussion_r1381259350
##########
sshd-git/src/main/java/org/apache/sshd/git/pack/GitPackCommand.java:
##########
@@ -77,7 +79,11 @@ public void run() {
Repository db = key.open(true /* must exist */);
String subCommand = args[0];
if (RemoteConfig.DEFAULT_UPLOAD_PACK.equals(subCommand)) {
- new UploadPack(db).upload(getInputStream(), getOutputStream(),
getErrorStream());
+ UploadPack uploadPack = new UploadPack(db);
+ String protocol = this.getEnvironment().getEnv()
+
.getOrDefault(GitProtocolConstants.PROTOCOL_ENVIRONMENT_VARIABLE, "version=0");
Review Comment:
`version=0` should be a **literal constant** as well
```java
public final class GitProtocolConstants {
public static final String PROTOCOL_ENVIRONMENT_VARIABLE = "whatever";
public static final String DEFAULT_PROTOCOL_VALUE = "version=0";
}
```
and then the code here should be
```java
this.getEnvironment().getEnv()
.getOrDefault(GitProtocolConstants.PROTOCOL_ENVIRONMENT_VARIABLE,
GitProtocolConstants.DEFAULT_PROTOCOL_VALUE);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]