tea-create-pr: Add automatic rebase and autostash #1517
@ -30,11 +30,15 @@ if ! check_remote "$remoteUpstream"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
treefmt -C "$root_dir"
|
||||||
|
|
||||||
upstream_url=$(git remote get-url "$remoteUpstream")
|
upstream_url=$(git remote get-url "$remoteUpstream")
|
||||||
git fetch "$remoteUpstream"
|
set -x
|
||||||
|
git fetch "$remoteUpstream" && git rebase "$remoteUpstream"/main --autostash
|
||||||
|
set +x
|
||||||
repo=$(echo "$upstream_url" | sed -E 's#.*:([^/]+/[^.]+)\.git#\1#')
|
repo=$(echo "$upstream_url" | sed -E 's#.*:([^/]+/[^.]+)\.git#\1#')
|
||||||
|
|
||||||
treefmt -C "$root_dir"
|
|
||||||
git log --reverse --pretty="format:%s%n%n%b%n%n" "$remoteUpstream/$targetBranch..HEAD" > "$TMPDIR"/commit-msg
|
git log --reverse --pretty="format:%s%n%n%b%n%n" "$remoteUpstream/$targetBranch..HEAD" > "$TMPDIR"/commit-msg
|
||||||
|
|
||||||
|
|
||||||
@ -51,7 +55,7 @@ fi
|
|||||||
|
|
||||||
git push --force -u "$remoteFork" HEAD:refs/heads/"$tempRemoteBranch"
|
git push --force -u "$remoteFork" HEAD:refs/heads/"$tempRemoteBranch"
|
||||||
|
|
||||||
set -x
|
|
||||||
tea pr create \
|
tea pr create \
|
||||||
--repo "$repo" \
|
--repo "$repo" \
|
||||||
--head "$user:$tempRemoteBranch" \
|
--head "$user:$tempRemoteBranch" \
|
||||||
|
Loading…
Reference in New Issue
Block a user