[PATCH] dim: check for empty pulls

Jani Nikula jani.nikula at linux.intel.com
Tue May 15 10:34:52 UTC 2018


On Tue, 15 May 2018, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> This could be a parsing error of the pull (for all the people who
> don't use a script like dim pull-request to make sure all the silly
> details are right), or some confusion on the part of the sender, or
> something else.
>
> Either way not good to continue.
>
> Cc: Dave Airlie <airlied at gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  dim | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/dim b/dim
> index 9ec43df08c4a..65f793a19380 100755
> --- a/dim
> +++ b/dim
> @@ -939,6 +939,10 @@ function dim_apply_pull
>  	echo Pulling $pull_branch ...
>  
>  	git fetch $pull_branch
> +	if [[ $(git rev-list HEAD..FETCH_HEAD | wc -l) -eq 0 ]] ; then

How about:

if [[ -z "$(git rev-list HEAD..FETCH_HEAD)" ]]; then

BR,
Jani.

> +		warn_or_fail "Nothing in the pull request"
> +	fi
> +
>  	checkpatch_commit_push_range "HEAD..FETCH_HEAD"
>  
>  	if ! $DRY git pull $pull_branch ; then

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the dim-tools mailing list