diff options
author | Petter Mabäcker <petter@technux.se> | 2015-11-24 13:45:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:30:53 +0000 |
commit | 5ef9249bbae4f08eb9b981d10f31bd3348449c82 (patch) | |
tree | 6cf86907f5a9ad1968fac87d1b43b42c84b868e8 /scripts | |
parent | ac38d245878b618ddf56f9a68834d344500e45a6 (diff) | |
download | openembedded-core-5ef9249bbae4f08eb9b981d10f31bd3348449c82.tar.gz openembedded-core-5ef9249bbae4f08eb9b981d10f31bd3348449c82.tar.bz2 openembedded-core-5ef9249bbae4f08eb9b981d10f31bd3348449c82.zip |
create-pull-request: handle empty ODIR
In some situations you might end-up with an empty ODIR (pull-xx/). The
most common reason is that you have applied your patches on 'master'
branch (or you are by mistake standing on the 'master' branch),
this will result in the default behavior that 'git format-patch'
will try to diff master..master.
Solve this by aborting the script with a proper error code and message
if ODIR is empty after the 'git format-patch' call (that is expected
to generate the cover-letter and patches).
Signed-off-by: Petter Mabäcker <petter@technux.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create-pull-request | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request index 19ba58869f..a3744cceaa 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request @@ -185,6 +185,14 @@ fi # Generate the patches and cover letter git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null +if [ -z "$(ls -A $ODIR 2> /dev/null)" ]; then + echo "ERROR: $ODIR is empty, no cover letter and patches was generated!" + echo " This is most likely due to that \$RRELATIVE_TO..\$COMMIT_ID" + echo " ($RELATIVE_TO..$COMMIT_ID) don't contain any differences." + rmdir $ODIR + exit 1 +fi + [ -n "$RELDIR" ] && cd $pdir # Customize the cover letter |