[RFC PATCH 07/20] git-submodule.sh: create a "case" dispatch statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Create a "case/esac" dispatch statement at the end of git-submodule.sh
and move the contents of the trivial cmd_absorbgitdirs() function to
it.

This template will be expanded on in subsequent commits, but for now
we're moving the trivial "git submodule absorb-git-dirs" to it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 git-submodule.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index 70258eaf38e..fb13f818c63 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -554,11 +554,6 @@ cmd_sync()
 	git ${wt_prefix:+-C "$wt_prefix"} submodule--helper sync ${GIT_QUIET:+--quiet} ${recursive:+--recursive} -- "$@"
 }
 
-cmd_absorbgitdirs()
-{
-	git submodule--helper absorbgitdirs --prefix "$wt_prefix" "$@"
-}
-
 # This loop parses the command line arguments to find the
 # subcommand name to dispatch.  Parsing of the subcommand specific
 # options are primarily done by the subcommand implementations.
@@ -607,4 +602,11 @@ then
 	usage
 fi
 
-"cmd_$(echo $command | sed -e s/-/_/g)" "$@"
+case "$command" in
+absorbgitdirs)
+	git submodule--helper "$command" --prefix "$wt_prefix" "$@"
+	;;
+*)
+	"cmd_$(echo $command | sed -e s/-/_/g)" "$@"
+	;;
+esac
-- 
2.36.1.1178.gb5b1747c546




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux