Yet another case where something fell off - we can't compute
dim_branches before setup is done, so shovel it somewhere where that's
not the case.

v2: Also fixup bash completion.

Reported-by: Tvrtko Ursulin <tvrtko.ursu...@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
---
 bash_completion |  9 +++++++--
 dim             | 12 ++++++------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/bash_completion b/bash_completion
index 2905abb5de49..0ad0ec4c88fe 100644
--- a/bash_completion
+++ b/bash_completion
@@ -12,8 +12,13 @@ dim ()
 _dim ()
 {
        local cur cmds opts i
-       local nightly_branches=`(source ~/linux/drm-intel-rerere/nightly.conf ; 
echo $nightly_branches) | \
-               xargs -n 1 echo | grep '^origin' | sed -e 's/^origin\///'`
+
+       if [ -f ~/linux/drm-intel-rerere/nightly.conf ] ; then
+               local nightly_branches=`(source 
~/linux/drm-intel-rerere/nightly.conf ; echo $nightly_branches) | \
+                       xargs -n 1 echo | grep '^origin' | sed -e 
's/^origin\///'`
+       else
+               local nightly_branches=""
+       fi
        local upstream_branches="origin/master airlied/drm-next 
airlied/drm-fixes"
 
        cmds="setup nightly-forget update-branches"
diff --git a/dim b/dim
index 4b08291e487d..298874355c84 100755
--- a/dim
+++ b/dim
@@ -150,14 +150,14 @@ if [ "$subcommand" != "setup" -a "$subcommand" != "help" 
]; then
                        exit 1
                fi
        done
-fi
 
-#
-# Internal configuration that depends on a sane setup.
-#
+       #
+       # Internal configuration that depends on a sane setup.
+       #
 
-dim_branches=`(source $DIM_PREFIX/drm-intel-rerere/nightly.conf ; echo 
$nightly_branches) | \
-       xargs -n 1 echo | grep '^origin' | sed -e 's/^origin\///'`
+       dim_branches=`(source $DIM_PREFIX/drm-intel-rerere/nightly.conf ; echo 
$nightly_branches) | \
+               xargs -n 1 echo | grep '^origin' | sed -e 's/^origin\///'`
+fi
 
 # get message id from file
 # $1 = file
-- 
2.5.1

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

Reply via email to