Reset submodules before updating them to prevent merge conflicts on local changes to updated files

This commit is contained in:
Kevin MacMartin 2016-09-06 12:24:56 -04:00
parent 087151b9de
commit 2092c6d01a

3
update
View file

@ -62,7 +62,7 @@ function show_help {
} }
### SETUP ### SETUP
cd "$script_home" cd "$script_home" || exit
# delete old error log if it exists # delete old error log if it exists
[[ -f "$error_log" ]] \ [[ -f "$error_log" ]] \
@ -152,6 +152,7 @@ fi
# update each submodule to the new head and run 'git fetch --all' # update each submodule to the new head and run 'git fetch --all'
printf '%s' "$cbg_blue $c_reset$cbg_yellow + Fetching updates:$c_reset" printf '%s' "$cbg_blue $c_reset$cbg_yellow + Fetching updates:$c_reset"
git submodule foreach git reset --hard >/dev/null 2>&1
process_status="$(git submodule foreach git fetch --all 2>&1)" process_status="$(git submodule foreach git fetch --all 2>&1)"
if (( ! $? )); then if (( ! $? )); then
process_status=$(git submodule update --init --recursive 2>&1) process_status=$(git submodule update --init --recursive 2>&1)