From 9d086a9103ff176fb8437d354604f96487f0c691 Mon Sep 17 00:00:00 2001 From: Sumedha Pramod Date: Mon, 5 Feb 2018 17:10:54 -0800 Subject: [PATCH] Fix: Annotations upgrade script (#613) --- build/upgrade_annotations.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/build/upgrade_annotations.sh b/build/upgrade_annotations.sh index f04c3594c..8243c3b78 100755 --- a/build/upgrade_annotations.sh +++ b/build/upgrade_annotations.sh @@ -50,20 +50,18 @@ reset_to_master() { git remote add github-upstream git@github.com:box/box-content-preview.git || return 1 fi + # Fetch latest code + git fetch github-upstream || return 1; + git checkout master || return 1 + # The master branch should not have any commits if [[ $(git log --oneline ...github-upstream/master) != "" ]] ; then echo "----------------------------------------------------" - echo "Error in resetting to master!" + echo "Your branch has unmerged commits!" echo "----------------------------------------------------" exit 1 fi - # Update to latest code on GitHub master - git checkout master || return 1 - - # Fetch latest code with tags - git fetch github-upstream || return 1; - # Reset to latest code and clear unstashed changes git reset --hard github-upstream/master || return 1 }