aliases: git: consistent behavior for git users

The case block in git.aliases.bash does the right thing for vim users
that do not populate $EDITOR.  However vim users that populate $EDITOR
are met with the following error:

$ gd
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: preserving files...
Vim: Finished.

Fix this inconsistency by adding another case block in the else block
which handles passing the appropriate arguments to vim.

Signed-off-by: Michael Turquette <mturquette@deferred.io>
pull/182/merge^2
Mike Turquette 2013-01-05 14:55:53 -08:00 committed by Michael Turquette
parent 6140b8fe0b
commit 4fba1ce6d2
1 changed files with 7 additions and 1 deletions

View File

@ -47,5 +47,11 @@ if [ -z "$EDITOR" ]; then
;;
esac
else
alias gd="git diff | $EDITOR"
case $EDITOR in
*vim*)
alias gd="git diff | $EDITOR -R -"
;;
*)
alias gd="git diff | $EDITOR"
esac
fi