bash_completion: simplify if-else logic
authorSean Farley <sean.michael.farley@gmail.com>
Tue, 26 Nov 2013 13:55:33 -0600
changeset 20132 d14f9c4a4398
parent 20131 56df59cc4212
child 20133 f6c33fc59dbd
bash_completion: simplify if-else logic There is no change in functionality here but this makes refactoring this later easier.
contrib/bash_completion
--- a/contrib/bash_completion	Mon Nov 25 11:38:14 2013 -0500
+++ b/contrib/bash_completion	Tue Nov 26 13:55:33 2013 -0600
@@ -240,15 +240,11 @@
     fi
 
     if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then
-        if [ $canonical = 1 ]; then
+        if [[ $canonical = 1 || status != "$cmd"* ]]; then
             _hg_labels
             return 0
-        elif [[ status != "$cmd"* ]]; then
-            _hg_labels
-            return 0
-        else
-            return 1
         fi
+        return 1
     fi
 
     local aliascmd=$(_hg_cmd showconfig alias.$cmd | awk '{print $1}')