function fetch_code {
- # update local refs
- $GIT fetch $GIT_REMOTE > /dev/null
-
if [ -n "$GIT_PULL" ]; then
+ # 'git fetch' is unnecessary when pulling, plus it causes
+ # an extra password prompt when using SSH keys w/ passwords
announce "Pulling updates for $($GIT rev-parse --abbrev-ref HEAD)";
$GIT pull > /dev/null
elif [ -n "$GIT_TAG" ]; then
+ announce "Fetching Git remote $GIT_REMOTE"
+ $GIT fetch $GIT_REMOTE > /dev/null
announce "Checking out tag $GIT_TAG"
checkout_code "$GIT_TAG" "$GIT_TAG"
elif [ -n "$GIT_BRANCH" ]; then
+ announce "Fetching Git remote $GIT_REMOTE"
+ $GIT fetch $GIT_REMOTE > /dev/null
announce "Checking out branch $GIT_BRANCH"
checkout_code "$GIT_BRANCH" "$GIT_REMOTE/$GIT_BRANCH"