mirror of https://github.com/samply/bridgehead.git
feature: Added warning for modified working directories
This commit is contained in:
parent
9b3acb4899
commit
ebc1b87dc2
|
@ -51,6 +51,11 @@ for DIR in /etc/bridgehead $(pwd); do
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
report_error 1 "Unable to update git $DIR: $OUT"
|
report_error 1 "Unable to update git $DIR: $OUT"
|
||||||
fi
|
fi
|
||||||
|
OUT="$(git -C $DIR status --porcelain)"
|
||||||
|
if [ -n "$OUT" ]; then
|
||||||
|
report_error 1 "The workingdirectory in $DIR is modified. Following files are changed: $OUT"
|
||||||
|
fi
|
||||||
|
|
||||||
new_git_hash="$(git -C $DIR rev-parse --verify HEAD)"
|
new_git_hash="$(git -C $DIR rev-parse --verify HEAD)"
|
||||||
if [ "$old_git_hash" != "$new_git_hash" ]; then
|
if [ "$old_git_hash" != "$new_git_hash" ]; then
|
||||||
CHANGE="Updated git repository in ${DIR} from commit $old_git_hash to $new_git_hash"
|
CHANGE="Updated git repository in ${DIR} from commit $old_git_hash to $new_git_hash"
|
||||||
|
|
Loading…
Reference in New Issue