Created
June 1, 2020 14:59
-
-
Save bbarenblat/3efd1e3ecbba7b886a6cc9faa3236363 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright 2019 Google LLC | |
# SPDX-License-Identifier: Apache-2.0 | |
set -e | |
if [ $# -ne 1 ]; then | |
cat >&2 <<EOF | |
usage: git fetch-pr https://github.com/[repo]/pull/[number] | |
EOF | |
exit 129 | |
fi | |
exec git fetch $( | |
echo "$1" | | |
sed -E 's|^https?://(www\.)?github.com/([^/]+)/([^/]+)/pull/([^/]+).*|https://github.com/\2/\3 refs/pull/\4/head|') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment