summaryrefslogtreecommitdiff
path: root/bash/git.bash
blob: 365eac232f60dcbfe7bcbfc08f85fc81e657a3ee (plain)
1
2
3
4
5
6
7
8
# vi:syntax=sh

function get_git_state () {
	local GIT_STATUS=$(git status -bs)
	local GIT_BRANCH=$(echo $GIT_STATUS | grep "^## :")
	local GIT_CHANGED=$(echo $GIT_STATUS | grep -c "^ M")
	local GIT_UNTRACKED=$(echo $GIT_STATUS | grep -c "^??")
}