code: protected ObjectId resolveBranchOrTagOrCommitId( Repository repository,
                                                       String branchOrTagOrCommitId ) throws IOException {
          ObjectId objId = repository.resolve(branchOrTagOrCommitId);
          if (objId == null) {
              for (String remoteName : connector.remoteNames()) {
                  String branchRef = branchRefForName(branchOrTagOrCommitId, remoteName);
                  objId = repository.resolve(branchRef);
                  if (objId != null) break;
              }
          }
          return objId;
      }
docs: Resolve the branch name, tag name, or commit ID into the appropriate ObjectId. Note that the branch names are assumed to be
  from the {@link GitConnector#remoteName() remote}.
  
  @param repository the Repository object; may not be null
  @param branchOrTagOrCommitId the branch name, tag name, or commit ID; may not be null
  @return the resolved ObjectId, or null if the supplied string does not resolve to an object ID
  @throws IOException if there is a problem reading the Git repository