code: public Credentials toGrgit() {
          if (username != null && password != null) {
              return new Credentials(username, password);
          } else {
              return null;
          }
      }
docs: Converts to credentials for use in Grgit.
  @return {@code null} if both username and password are {@code null},
  otherwise returns credentials in Grgit format.