lgoldstein commented on code in PR #430:
URL: https://github.com/apache/mina-sshd/pull/430#discussion_r1418394044


##########
sshd-git/src/main/java/org/apache/sshd/git/transport/GitSshdSession.java:
##########
@@ -133,7 +132,16 @@ public Process exec(String commandName, int timeout) 
throws IOException {
             log.trace("exec({}) session={}, timeout={} sec.", commandName, 
session, timeout);
         }
 
-        ChannelExec channel = session.createExecChannel(commandName, null, 
version2Env);
+        ChannelExec channel;
+        Optional<String> protocolVer = 
GitModuleProperties.GIT_PROTOCOL_VERSION.get(session);
+        if (protocolVer.isPresent()) {

Review Comment:
   Recommend using the following code:
   ```java
   Optional<String> protocolVer = 
GitModuleProperties.GIT_PROTOCOL_VERSION.get(session);
   String protocol = protocolVer.orElse(null);
   if (GenericUtils.isNotBlank(protocol)) {
       ...
   }
   ```
   ```



##########
sshd-git/src/main/java/org/apache/sshd/git/pack/GitPackCommand.java:
##########
@@ -80,9 +80,10 @@ public void run() {
             String subCommand = args[0];
             if (RemoteConfig.DEFAULT_UPLOAD_PACK.equals(subCommand)) {
                 UploadPack uploadPack = new UploadPack(db);
-                String protocol = this.getEnvironment().getEnv()
-                        
.getOrDefault(GitProtocolConstants.PROTOCOL_ENVIRONMENT_VARIABLE, "version=0");
-                uploadPack.setExtraParameters(Collections.singleton(protocol));
+                String protocol = 
this.getEnvironment().getEnv().get(GitProtocolConstants.PROTOCOL_ENVIRONMENT_VARIABLE);
+                if (protocol != null) {

Review Comment:
   Recommend using
   ```java
   if (GenericUtils.isNotBlank(protocol)) {
       ...
   }
   ```
   ```



-- 
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: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to