#!/bin/sh -ex

for pr in "$@"; do
    git fetch origin "refs/pull/$pr/head"
    git merge -m "Merge pull request $pr" FETCH_HEAD
done
