[Intel-gfx] [maintainer-tools RFC PATCH 11/17] dim: move dim_pull_request parameter check to the function
Jani Nikula
jani.nikula at intel.com
Tue Jan 26 06:32:24 PST 2016
More abstraction is better, also guards against invalid internal use.
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
dim | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dim b/dim
index b9152a256a26..34f2312be37a 100755
--- a/dim
+++ b/dim
@@ -581,6 +581,11 @@ function dim_create_workdir
# dim_pull_request branch upstream
function dim_pull_request
{
+ if [[ "x$1" = "x" || "x$2" = "x" ]]; then
+ echo "usage: $0 $subcommand branch upstream"
+ exit 1
+ fi
+
branch=$1
upstream=$2
@@ -864,10 +869,6 @@ case "$subcommand" in
$DRY git cherry-pick $1
;;
pull-request)
- if [[ "x$1" = "x" || "x$2" = "x" ]]; then
- echo "usage: $0 $subcommand branch upstream"
- exit 1
- fi
dim_pull_request $*
;;
pull-request-next)
--
2.1.4
More information about the Intel-gfx
mailing list