Skip to content

Commit

Permalink
Fix resetting a README dependency when the hash exists, but the branc…
Browse files Browse the repository at this point in the history
…h does not. Fixes #4308. (#4310)

Fix this by checking if the branch exists, and if not, fetch the repository.

Also add a better error message if the remote doesn't have the requested branch.

Fixes #4308.
  • Loading branch information
rolfbjarne committed Jun 21, 2018
1 parent fa39181 commit de0578a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mk/xamarin-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ if test -d "$DEPENDENCY_PATH"; then
if ! git log -1 --pretty=%H "$DEPENDENCY_HASH" > /dev/null 2>&1; then
echo "*** [$DEPENDENCY_NAME] git fetch $DEPENDENCY_REMOTE"
git fetch "$DEPENDENCY_REMOTE"
elif ! git rev-parse --verify "$DEPENDENCY_REMOTE/$DEPENDENCY_BRANCH" > /dev/null 2>&1; then
# Also check if we have the branch we need, we might already have the hash, but not the branch
echo "*** [$DEPENDENCY_NAME] git fetch $DEPENDENCY_REMOTE"
git fetch "$DEPENDENCY_REMOTE"
fi

else
echo "*** [$DEPENDENCY_NAME] git clone $DEPENDENCY_MODULE --recursive $DEPENDENCY_DIRECTORY -b $DEPENDENCY_BRANCH --origin $DEPENDENCY_REMOTE"
mkdir -p "$(dirname "$DEPENDENCY_PATH")"
Expand All @@ -30,6 +35,9 @@ fi
if ! git log -1 --pretty=%H "$DEPENDENCY_HASH" > /dev/null 2>&1; then
echo "The hash $DEPENDENCY_HASH does not exist in $DEPENDENCY_MODULE. Please verify that you pushed your changes."
exit 1
elif ! git rev-parse --verify "$DEPENDENCY_REMOTE/$DEPENDENCY_BRANCH" > /dev/null 2>&1; then
echo "The branch $DEPENDENCY_BRANCH does not exist in $DEPENDENCY_MODULE. Please verify that you pushed your changes."
exit 1
fi

if test -z "$DEPENDENCY_IGNORE_VERSION"; then
Expand Down

2 comments on commit de0578a

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Jenkins job (on internal Jenkins) failed in stage 'Test run' 🔥 : hudson.AbortException: script returned exit code 2

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
🔥 Test run failed 🔥

Test results

2 tests failed, 0 tests skipped, 223 tests passed.

Failed tests

  • System.Web.Services/watchOS - simulator/Debug: Failed
  • monotouch-test/watchOS - simulator/Debug (static registrar): Failed

@rolfbjarne
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failures are known issues (https://github.com/xamarin/maccore/issues/581)

Please sign in to comment.