diff --git a/pipelines/shared-tasks/create-or-update-pr/task.sh b/pipelines/shared-tasks/create-or-update-pr/task.sh index 69ce87a8f..6df432a59 100755 --- a/pipelines/shared-tasks/create-or-update-pr/task.sh +++ b/pipelines/shared-tasks/create-or-update-pr/task.sh @@ -55,12 +55,15 @@ else echo "The branch already exists, so pull it." # Fetch all the remote branches so we can use one of them. git fetch https_origin + echo "Comparing local changes to remote branch..." # Check if our local changes are different from what is already on the remote branch. stagedAndUnstagedDiffs=$(git --no-pager diff https_origin/"$BRANCH") if [[ "$stagedAndUnstagedDiffs" == "" ]]; then - # The changes that we made locally are the same as what is already on the branch. echo "Local git changes are the same as what is already on remote branch $BRANCH. Done." exit 0 + else + echo "Local and remote had diffs:" + echo "$stagedAndUnstagedDiffs" fi # Stash our changes before using git checkout and git reset, which both can throw away local changes. git status