When using worktree, the src repo might already have a master
branch, which would make dim setup fail. Since maintainer-tools
is now a simple stand-alone repo, we can just do a simple git clone
instead of using the worktree. Also, rename the branch in the repo
to maintainer-tools since that is what other parts of dim expect.

v2: use simple git clone instead of using worktree and specifying
    the branch name (Daniel), update commit title and message
    accordingly.

Cc: Daniel Vetter <[email protected]>
Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
---
 dim | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 9b20154d0c92..e97a2b14defd 100755
--- a/dim
+++ b/dim
@@ -2067,6 +2067,20 @@ function dim_status
        done
 }
 
+function setup_maintainer_tools_checkout
+{
+       local dir branch
+
+       dir=$DIM_PREFIX/maintainer-tools
+       branch=maintainer-tools
+
+       if [ ! -d $dir ]; then
+               echo "Setting up maintainer-tools ..."
+               git clone $maintainer_tools_https $dir
+               git --git-dir=$dir/.git branch -m $branch
+       fi
+}
+
 function setup_aux_checkout # name url directory
 {
        local name url dir remote
@@ -2131,7 +2145,7 @@ function dim_setup
 
        cd $DIM_PREFIX
 
-       setup_aux_checkout master $maintainer_tools_https maintainer-tools
+       setup_maintainer_tools_checkout
 
        setup_aux_checkout rerere-cache $drm_tip_ssh drm-rerere
 
-- 
2.19.2

_______________________________________________
dim-tools mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dim-tools

Reply via email to