This commit is contained in:
@@ -50,14 +50,27 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HAS_GIT= [ -f $(which git) ] && [ -x $(which git) ]
|
HAS_GIT= [ -f $(command -v git) ] && [ -x $(command -v git) ]
|
||||||
export HAS_GIT
|
export HAS_GIT
|
||||||
|
|
||||||
git_commit_ID () {
|
is_git_dir () {
|
||||||
if ${HAS_GIT};
|
if ${HAS_GIT}
|
||||||
then
|
then
|
||||||
# This does NOT indicate if there are any modified files!
|
return $(cd "$1"; git status >/dev/null 2>/dev/null; echo $?)
|
||||||
COMMIT_ID=$(git -C "$1" rev-parse --short HEAD)
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
git_commit_ID () {
|
||||||
|
if ${HAS_GIT}
|
||||||
|
then
|
||||||
|
if is_git_dir "$1"
|
||||||
|
then
|
||||||
|
# This does NOT indicate if there are any modified files!
|
||||||
|
COMMIT_ID=$(git -C "$1" rev-parse --short HEAD)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user