No functional change, only moving from the
case to its own function, with the arguments now shifted.

It seems that the argument for branch_init is useles,
but I will keep it for now to avoid any change
that is not related to the new subcommand scheme.

Cc: Jani Nikula <jani.nik...@intel.com>
Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahti...@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.v...@intel.com>
---
 qf | 61 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/qf b/qf
index c02fb75a4e3a..0f8c706763f8 100755
--- a/qf
+++ b/qf
@@ -170,36 +170,6 @@ function quilt_clean_check
 }
 
 case "$1" in
-       setup)
-               cd `git rev-parse --show-toplevel`
-
-               if [[ -d patches ]] ; then
-                       if [[ ! -d patches/.git ]] ; then
-                               echo patches/ directory exists, but not 
initialized.
-                               echo Please fix manually.
-                               exit 11
-                       fi
-
-                       echo Quilt repo already set up.
-               else
-                       repo_init
-               fi
-
-
-               if [[ -n $2 ]] ; then
-                       if ! git branch | grep $2 &> /dev/null ; then
-                               echo $2 is not a branch in the main repo, 
aborting.
-                               exit 13
-                       fi
-
-                       branch=$2
-                       quilt_branch=$QUILT_PREFIX$branch
-                       baseline=`git rev-parse $2`
-                       remote=`git config branch.$branch.remote`
-
-                       branch_init $3
-               fi
-               ;;
        checkout|co)
                cd_toplevel
 
@@ -470,6 +440,37 @@ else
     shift
 fi
 
+function qf_setup
+{
+       cd `git rev-parse --show-toplevel`
+
+       if [[ -d patches ]] ; then
+               if [[ ! -d patches/.git ]] ; then
+                       echo patches/ directory exists, but not initialized.
+                       echo Please fix manually.
+                       exit 11
+               fi
+
+               echo Quilt repo already set up.
+       else
+               repo_init
+       fi
+
+       if [[ -n $1 ]] ; then
+               if ! git branch | grep $1 &> /dev/null ; then
+                       echo $1 is not a branch in the main repo, aborting.
+                       exit 13
+               fi
+
+               branch=$1
+               quilt_branch=$QUILT_PREFIX$branch
+               baseline=`git rev-parse $1`
+               remote=`git config branch.$branch.remote`
+
+               branch_init $2
+       fi
+}
+
 function qf_help
 {
        manpage=$DIM_PREFIX/maintainer-tools/qf.rst
-- 
2.13.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to