Created fail_if_not_git_repo function and prepended it to all git functions

This commit is contained in:
Nathan Broadbent
2012-09-19 21:34:03 +12:00
parent 197dcfc74f
commit 384f2a0668
3 changed files with 14 additions and 5 deletions

View File

@@ -12,6 +12,7 @@
# Adds numbered shortcuts to output of ls -l, just like 'git status'
unalias $git_branch_alias > /dev/null 2>&1; unset -f $git_branch_alias > /dev/null 2>&1
function _scmb_git_branch_shortcuts {
fail_if_not_git_repo || return 1
# Fall back to normal git branch, if any unknown args given
if [[ -n "$@" ]] && [[ "$@" != "-a" ]]; then
$_git_cmd branch "$@"