github-merge-pr: be more conservative with git fetch
[maintainer-tools.git] / github-merge-pr.sh
index 191a5b15f8989da5a3fb98c3d18b3aa2d102d094..863d3b753aa0d5bd0c15156ba4e8171f7b320143 100755 (executable)
@@ -65,7 +65,7 @@ fi
 
 echo "Pulling current $BRANCH from origin"
 $GIT checkout $BRANCH
-$GIT fetch origin
+$GIT fetch origin $BRANCH
 
 if ! $GIT rebase origin/$BRANCH; then
        echo "Failed to rebase $BRANCH with origin/$BRANCH" >&2
@@ -83,7 +83,7 @@ if ! $GIT remote get-url $PR_USER &> /dev/null || [ -n "$DRY_RUN" ]; then
 fi
 
 echo "Fetching remote $PR_USER"
-$GIT fetch $PR_USER
+$GIT fetch $PR_USER $PR_BRANCH
 
 if [ "$(echo "$PR_INFO" | jq -r ".maintainer_can_modify")" == "true" ]; then
        echo "Creating branch $LOCAL_PR_BRANCH for $PR_BRANCH"