Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -287,28 +287,6 @@ function do_enter() {
zle accept-line
fi
}
# git の alias では変えられない既存のコマンドの動作を変更す
function wrapped_git() {
# switch に強制する
#if [[ "$1" = "checkout" ]]; then
# echo -e "\033[1;41mUse switch or restore!\033[00m"
# push のみなのに track してなかったら set-upstream をサジェストする
if [[ "$*" = "push" ]] && in_git && ! (\git rev-parse --abbrev-ref @{upstream} >/dev/null 2>&1); then
suggest="push -u origin $(\git rev-parse --abbrev-ref HEAD)"
ask_ynae "git $suggest"
exit_code=$?
echo
case $exit_code in
"0" ) \git ${=suggest} ;;
"1" ) \git $@ ;;
"2" ) return 130 ;;
"3" ) print -z "git $@" ;;
esac
else
\git $@
fi
}
alias git=wrapped_git

##################
## キーバインド ##
Expand Down