* @return {@code null} if both username and password are {@code null},
* otherwise returns credentials in Grgit format.
*/
public Credentials toGrgit() {
if (username != null && password != null) {
return new Credentials(username, password);
} else {
return null;
}
}