From 5dc69ba6e17d534fa0defdcb7c6181203cd063fd Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 25 Mar 2016 00:11:38 -0400 Subject: [PATCH] ensure upstream is set correctly on apply patches --- applyPatches.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/applyPatches.sh b/applyPatches.sh index 029aad9ee6..515cf05d1b 100755 --- a/applyPatches.sh +++ b/applyPatches.sh @@ -9,6 +9,7 @@ function applyPatch { what_name=$(basename $what) target=$2 branch=$3 + cd "$basedir/$what" git fetch git branch -f upstream "$branch" >/dev/null @@ -19,8 +20,9 @@ function applyPatch { fi cd "$basedir/$target" echo "Resetting $target to $what_name..." - git remote add -f upstream ../$what >/dev/null 2>&1 - git checkout master >/dev/null 2>&1 + git remote rm upstream > /dev/null 2>&1 + git remote add upstream $basedir/$what >/dev/null 2>&1 + git checkout master 2>/dev/null || git checkout -b master git fetch upstream >/dev/null 2>&1 git reset --hard upstream/upstream echo " Applying patches to $target..."