From: Christian Marangi Date: Thu, 2 Nov 2023 19:36:06 +0000 (+0100) Subject: github-merge-pr: be more conservative with git fetch X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e5e4154d15f6d1c178783bd5f6e5b37510d1f81c;p=maintainer-tools.git 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 --- 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"