Prepare "tg depend" for new subcommands by moving the implementation
of "tg add" to a function.
Signed-off-by: Per Cederqvist <ceder@lysator.liu.se>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
die "invalid branch name: $name"
## Record new dependency
+depend_add()
+{
+ echo "$name" >>"$root_dir/.topdeps"
+ git add -f "$root_dir/.topdeps"
+ git commit -m"New TopGit dependency: $name"
+ $tg update
+}
-echo "$name" >>"$root_dir/.topdeps"
-git add -f "$root_dir/.topdeps"
-git commit -m"New TopGit dependency: $name"
-$tg update
+depend_$subcmd
# vim:noet