don't try to commit if nothing has changed
This commit is contained in:
parent
7e5b571fc9
commit
ee93e19130
|
@ -61,10 +61,11 @@ if test -x "${GIT_BIN}"; then
|
|||
export GIT_DIR="${dir}/.git" GIT_WORK_TREE="${dir}"
|
||||
# If the repository and the work tree exist, try to commit changes
|
||||
if test -d "${GIT_DIR}" && test -d "${GIT_WORK_TREE}"; then
|
||||
${GIT_BIN} add --all
|
||||
${GIT_BIN} commit --message "${TEXTE}" --author="${USER} <${USER}@evolix.net>" --quiet
|
||||
# Add the SHA to the log file if something has been committed
|
||||
if [ "$?" = "0" ]; then
|
||||
CHANGED_LINES=$(git status --porcelain | wc -l)
|
||||
if [ "${CHANGED_LINES}" != "0" ]; then
|
||||
${GIT_BIN} add --all
|
||||
${GIT_BIN} commit --message "${TEXTE}" --author="${USER} <${USER}@evolix.net>" --quiet
|
||||
# Add the SHA to the log file if something has been committed
|
||||
SHA=$(git rev-parse HEAD)
|
||||
echo "${dir} : ${SHA}" >> "${LOGFILE}"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue