class UIGit extends VCS implements IVCS {

  @Override
  public boolean pull() {
    if ( hasUncommittedChanges() ) {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ),
        BaseMessages.getString( PKG, "Git.Dialog.UncommittedChanges.Message" ) );
      return false;
    }
    if ( !hasRemote() ) {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), "Please setup a remote" );
      return false;
    }

    try {
      // Pull = Fetch + Merge
      git.fetch().setCredentialsProvider( credentialsProvider ).call();
      return mergeBranch( Constants.DEFAULT_REMOTE_NAME + "/" + getBranch(), MergeStrategy.RECURSIVE.getName() );
    } catch ( TransportException e ) {
      if ( e.getMessage().contains( "Authentication is required but no CredentialsProvider has been registered" )
        || e.getMessage().contains( "not authorized" ) ) { // when the cached credential does not work
        if ( promptUsernamePassword() ) {
          return pull();
        }
      } else {
        showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
      }
    } catch ( Exception e ) {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
    }
    return false;
  }

}