]> code.ossystems Code Review - openembedded-core.git/commitdiff
create-pull-request: Fix error on 2.0 versions of git
authorBen Shelton <ben.shelton@ni.com>
Mon, 4 Aug 2014 18:55:49 +0000 (13:55 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Jul 2015 14:08:43 +0000 (15:08 +0100)
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@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/create-pull-request

index 97ed874e7f9ff7a5bb9fdf6d056db14b373745e9..bc897468ef67142980c032589a4ad04c93728034 100755 (executable)
@@ -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