[oe-commits] Ben Shelton : create-pull-request: Fix error on 2.0 versions of git
git at git.openembedded.org
git at git.openembedded.org
Thu Jul 16 14:10:15 UTC 2015
Module: openembedded-core.git
Branch: master
Commit: 7ee64ea60ede5477b2f9a355d93bdc556e6b7895
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=7ee64ea60ede5477b2f9a355d93bdc556e6b7895
Author: Ben Shelton <ben.shelton at ni.com>
Date: Mon Aug 4 13:55:49 2014 -0500
create-pull-request: Fix error on 2.0 versions of git
On 2.0 versions of git, the create-pull-request script exits with the
warning "No match for commit... Are you sure you pushed 'HEAD' there?".
This is due to a change in behavior where git used to guess the branch
you meant, but no longer does. See the thread at
http://www.spinics.net/lists/git/msg233050.html for more information.
To accommodate the new behavior, if the COMMIT_ID is set to the default
of "HEAD", make it point explicitly to $BRANCH instead.
Signed-off-by: Ben Shelton <ben.shelton at ni.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
scripts/create-pull-request | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 97ed874..bc89746 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -125,6 +125,10 @@ if [ -z "$BRANCH" ]; then
echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."
fi
+if [ "$COMMIT_ID" == "HEAD" ]; then
+ COMMIT_ID="$BRANCH"
+fi
+
if [ -z "$REMOTE_URL" ]; then
echo "ERROR: Missing parameter -u, no git remote!"
usage
More information about the Openembedded-commits
mailing list