Commit f8ed2bf8 authored by Oliver Pinter's avatar Oliver Pinter
Browse files

HBSD: optimize hardenedBSD_update_and_push.csh



Do not blindly reset the git tree is there are no changes.
Signed-off-by: default avatarOliver Pinter <oliver.pinter@hardenedbsd.org>
parent baf9d493
......@@ -67,9 +67,15 @@ foreach line ( ${BRANCHES} )
# show, that branch correctly switched
(git branch) |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
echo "==== drop stale changes ====" |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
# drop any stale change
(git reset --hard HEAD) |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
echo "==== check for stale changes ====" |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
set changed_files=`git status --porcelain -uall | wc -c`
if ( ${changed_files} != 0 ) then
echo "==== drop stale changes ====" |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
# drop any stale change
(git status) |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
(git reset --hard HEAD) |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
endif
echo "==== update to latest origin ====" |& ${TEE_CMD} ${LOGS}/${_branch}-${DATE}.log
# pull in latest changes from main repo
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment