From e5e4154d15f6d1c178783bd5f6e5b37510d1f81c Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 2 Nov 2023 20:36:06 +0100 Subject: [PATCH] github-merge-pr: be more conservative with git fetch Be more conservative with git fetch and fetch only the require branch for both origin and PR branch. This should speedup git fetch and save on disk space as only the required history and changes are downloaded. Signed-off-by: Christian Marangi --- github-merge-pr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github-merge-pr.sh b/github-merge-pr.sh index 191a5b1..863d3b7 100755 --- a/github-merge-pr.sh +++ b/github-merge-pr.sh @@ -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" -- 2.30.2