[maintainer-tools] github-merge-pr: be more conservative with git fetch
LEDE Commits
lede-commits at lists.infradead.org
Thu Nov 2 12:37:20 PDT 2023
ansuel pushed a commit to maintainer-tools.git, branch master:
https://git.openwrt.org/e5e4154d15f6d1c178783bd5f6e5b37510d1f81c
commit e5e4154d15f6d1c178783bd5f6e5b37510d1f81c
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Nov 2 20:36:06 2023 +0100
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 <ansuelsmth at gmail.com>
---
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"
More information about the lede-commits
mailing list