summaryrefslogtreecommitdiffstats
path: root/easy_e17.sh
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-09-06 08:17:56 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-09-06 08:17:56 +0200
commit4a792f16a092b2305686f0121c2129d5b61cf715 (patch)
tree5cbe72fbd030a7471424165cfe333563aa9f7b25 /easy_e17.sh
parentdfce96009f553e9f1bb8f9601407e0479b849785 (diff)
downloadbin-4a792f16a092b2305686f0121c2129d5b61cf715.zip
bin-4a792f16a092b2305686f0121c2129d5b61cf715.tar.gz
easy_e17.sh: checkout blocking files on pull error
Diffstat (limited to 'easy_e17.sh')
-rwxr-xr-xeasy_e17.sh7
1 files changed, 6 insertions, 1 deletions
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