From 4a792f16a092b2305686f0121c2129d5b61cf715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 6 Sep 2011 08:17:56 +0200 Subject: easy_e17.sh: checkout blocking files on pull error --- easy_e17.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/easy_e17.sh b/easy_e17.sh index 1d2559b..20806fb 100755 --- a/easy_e17.sh +++ b/easy_e17.sh @@ -806,7 +806,12 @@ function git_fetch () git status -s | grep -e '^??' | cut -d " " -f 2 | xargs rm 2>/dev/null SHA_PREV=$(git log --pretty="format:%H" HEAD~1..) echo "- pull from `git remote -v | grep origin | grep fetch | cut -f 2 |cut -d " " -f 1`" - git pull --no-stat + git pull --no-stat 2>&1 | tee "$tmp_path/pull_error.log" + if [ $(cat "$tmp_path/pull_error.log" | grep $'^\t' | wc -l) -gt 0 ]; then + echo "- checkout pull blocking files" + cat "$tmp_path/pull_error.log" | grep $'^\t' | while read file; do git checkout "$file"; done + git pull --no-stat + fi SHA_HEAD=$(git log --pretty="format:%H" HEAD~1..) git show ${SHA_PREV}..${SHA_HEAD} --name-only --pretty="format:" | sort | uniq | grep -v -e '^$' | cut -d " " -f 1 > "$tmp_path/source_update.log" else -- cgit v1.1-2-g2b99