     else
       view.reset()
     view.finish()
+    git.refresh repo
   .catch (msg) =>
     if msg?.length > 0
       view.setContent msg
     else
       view.reset()
     view.finish()
+    git.refresh repo
   return promise
 
 class InputView extends View

notifier = require '../notifier'
OutputViewManager = require '../output-view-manager'

runCommand = (args, workingDirectory) ->
  view = OutputViewManager.create()
  promise = git.cmd(args, cwd: workingDirectory, {color: true})
  promise
  .then (data) ->
    msg = "git #{args.join(' ')} was successful"
    notifier.addSuccess(msg)
    if data?.length > 0

    @disposables.add atom.commands.add 'atom-text-editor', 'core:confirm', (e) =>
      @disposables.dispose()
      @panel?.destroy()
      runCommand(@repo, @commandEditor.getText().split(' ')).then =>
        @currentPane.activate()
        git.refresh @repo

module.exports = (repo, args=[]) ->
  if args.length > 0
    runCommand repo, args.split(' ')
  else
    new InputView(repo)
