Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
bash: remove unnecessary conditions when checking for subcommands
author
SZEDER Gábor
<szeder@ira.uka.de>
Mon, 10 Mar 2008 15:02:22 +0000
(16:02 +0100)
committer
Shawn O. Pearce
<spearce@spearce.org>
Mon, 10 Mar 2008 23:45:20 +0000
(19:45 -0400)
Checking emptyness of $command is sufficient.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
contrib/completion/git-completion.bash
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a5c4f85
)
diff --git
a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index c29569c6247c346ceb409f72ff8e135929e11141..a94dc88fdc6c5f205bc423e3f7d78e755517118e 100755
(executable)
--- a/
contrib/completion/git-completion.bash
+++ b/
contrib/completion/git-completion.bash
@@
-497,7
+497,7
@@
_git_bisect ()
c=$((++c))
done
c=$((++c))
done
- if [
$c -eq $COMP_CWORD -a
-z "$command" ]; then
+ if [ -z "$command" ]; then
__gitcomp "start bad good reset visualize replay log"
return
fi
__gitcomp "start bad good reset visualize replay log"
return
fi
@@
-1042,7
+1042,7
@@
_git_remote ()
c=$((++c))
done
c=$((++c))
done
- if [
$c -eq $COMP_CWORD -a
-z "$command" ]; then
+ if [ -z "$command" ]; then
__gitcomp "add rm show prune update"
return
fi
__gitcomp "add rm show prune update"
return
fi
@@
-1135,7
+1135,7
@@
_git_submodule ()
c=$((++c))
done
c=$((++c))
done
- if [
$c -eq $COMP_CWORD -a
-z "$command" ]; then
+ if [ -z "$command" ]; then
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@
-1198,7
+1198,7
@@
_git ()
c=$((++c))
done
c=$((++c))
done
- if [
$c -eq $COMP_CWORD -a
-z "$command" ]; then
+ if [ -z "$command" ]; then
case "${COMP_WORDS[COMP_CWORD]}" in
--*=*) COMPREPLY=() ;;
--*) __gitcomp "
case "${COMP_WORDS[COMP_CWORD]}" in
--*=*) COMPREPLY=() ;;
--*) __gitcomp "