anchor.diff:    }
   }
   
  +abstract class SparkActionWithStatusDialog extends SparkActionWithProgressDialog {
  +  SparkActionWithStatusDialog(Spark spark,
  +                              String id,
  +                              String name,
  +                              Element dialogElement)
  +      : super(spark, id, name, dialogElement);
  +
  +  /**
  +   * Shows a
  +   */
  +
  +  void _showStatusDialog(String title, String progressMessage) {
  +    _dialog.dialog.title = title;
  +    _setProgressMessage(progressMessage);
  +    _toggleProgressVisible(true);
  +    _show();
  +  }
  +
  +  /**
  +   * Show the status dialog at least for 3 seconds. The dialog is closed when
  +   * the given future [f] is completed.
  +   */
  +  void _waitForJob(Future f) {
  +    // Show dialog for at least 3 seconds.
  +    Timer timer = new Timer(new Duration(milliseconds: 3000), () {
  +      f.whenComplete(() {
  +        _setProgressMessage('');
  +        _toggleProgressVisible(true);
  +        _hide();
  +      });
  +    });
  +    _show();
  +  }
  +}
  +
   class FileOpenAction extends SparkAction {
     FileOpenAction(Spark spark) : super(spark, "file-open", "Open File…") {
       addBinding("ctrl-o");
  
positive.code:       files.add(resource.entry);
      });
  
      _dialog.dialog.title = 'Git Add';
      String branchName = operations.getBranchName();
      _setProgressMessage('Adding files to git...');
      _toggleProgressVisible(true);
  
      Future f = spark.jobManager.schedule(new _GitAddJob(operations, files, spark));
      // Show dialog for at lest 2 seconds.
      Timer timer = new Timer(new Duration(milliseconds: 2000), () {
        f.whenComplete(() {
          _setProgressMessage('');
          _toggleProgressVisible(true);
          _hide();
        });
      });
  
      _show();
    }
  
    String get category => 'git';
  
negative.code:   }
  }
  
  class GitPullAction extends SparkActionWithStatusDialog implements ContextAction {
    GitPullAction(Spark spark, SparkDialog dialog)
        : super(spark, "git-pull", "Pull from Origin", dialog);
  
    void _invoke([context]) {
      ws.Project project = context.first.project;
      ScmProjectOperations operations = spark.scmManager.getScmOperationsFor(project);
      Future f = spark.jobManager.schedule(new _GitPullJob(operations, spark));
      _waitForJob(f);
      String branchName = operations.getBranchName();
      _showStatusDialog('Git Pull', 'Updating ${branchName}…');
  
    }
  
    String get category => 'git';
  