summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-03-04 01:15:04 +0100
committerHugues Hiegel <hugues@hiegel.fr>2008-03-07 14:15:21 +0100
commitc9f26850a3d7360c5542838780f40e2a00c1d583 (patch)
tree293294085971ec20c9f7db9afcf7e5aa89a3d2e1
parentf176f894daa2ef723248b32807a234c26b718a24 (diff)
Get rid of error messages inside .git folders..
-rw-r--r--01_Functions.zsh8
1 files changed, 4 insertions, 4 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh
index f6b300a..b28d5a2 100644
--- a/01_Functions.zsh
+++ b/01_Functions.zsh
@@ -39,8 +39,8 @@ preprint()
get_git_branch ()
{
- my_git_branch="$(git branch 2>&- | grep -E '^\* ' | cut -c3-)"
- [ $my_git_branch == "(no branch)" ] && my_git_branch="$(git-log HEAD~1..HEAD --pretty=format:%h)"
+ my_git_branch="$(git-branch 2>&- | grep -E '^\* ' | cut -c3-)"
+ [ $my_git_branch == "(no branch)" ] && my_git_branch="$(git-log HEAD~1..HEAD --pretty=format:%h 2>&-)"
echo $my_git_branch
}
@@ -55,9 +55,9 @@ check_git_status ()
then
#preprint "Check git status..."
#_git_status=$(git-status 2>&- | grep -E '^# ([[:alpha:]]+ )+(but not|to be)( [[:alpha:]]+)+:$')
- if [ "$(git-diff --cached | grep '^diff ')" != "" ] ; then
+ if [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then
COLOR_GIT=$COLOR_TO_BE_COMMITED
- elif [ "$(git-ls-files -m)" != "" ] ; then
+ elif [ "$(git-ls-files -m 2>&-)" != "" ] ; then
COLOR_GIT=$COLOR_NOT_UP_TO_DATE
else
COLOR_GIT=$COLOR_BRANCH_OR_REV