diff options
Diffstat (limited to 'include/git.sh')
-rwxr-xr-x | include/git.sh | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/include/git.sh b/include/git.sh index 9a73bd92..e361cb41 100755 --- a/include/git.sh +++ b/include/git.sh @@ -36,8 +36,8 @@ fetch_config() eval "$(setvars "" rev tree)" _xm="fetch_config ${project}/${_target}" load_target_config "${_target}" - [ "${_target}" != "${tree}" ] && _target="${tree}" && continue - break + [ "${_target}" = "${tree}" ] && break + _target="${tree}" done } @@ -65,14 +65,9 @@ prepare_new_tree() cp -R "src/${project}/${project}" "${tmp_git_dir}" || \ err "prepare_new_tree ${project}/${tree}: can't make tmpclone" git_reset_rev "${tmp_git_dir}" "${rev}" - ( - cd "${tmp_git_dir}" || \ - err "prepare_new_tree ${project}/${tree}: can't cd tmpclone" - if [ -f ".gitmodules" ]; then - git submodule update --init --checkout || \ - err "prepare_new_tree ${project}/${tree}: !submodules" - fi - ) || err "git submodule update failure" + [ ! -f "${tmp_git_dir}/.gitmodules" ] || \ + git -C "${tmp_git_dir}" submodule update --init --checkout \ + || err "prepare_new_tree ${project}/${tree}: !submodules" git_am_patches "${tmp_git_dir}" "$PWD/$cfgsdir/$tree/patches" || \ err "prepare_new_tree ${project}/${tree}: patch fail" [ "${patchfail}" = "y" ] && err "PATCH FAIL" @@ -151,10 +146,9 @@ git_am_patches() [ -L "${patch}" ] && continue [ -f "${patch}" ] || continue git am "${patch}" || patchfail="y" - if [ "${patchfail}" = "y" ]; then - git am --abort || err "${sdir}: !git am --abort" - err "!git am ${patch} -> ${sdir}" - fi + [ "${patchfail}" != "y" ] && continue + git am --abort || err "${sdir}: !git am --abort" + err "!git am ${patch} -> ${sdir}" done ) || err "PATCH FAILURE" for patches in "${patchdir}/"*; do |