Permalink
Browse files

Generalize subcommand selection in "tg depend"

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>
  • Loading branch information...
1 parent 913035b commit bd0a68e9716f944cb12848bee4649958f7db7eb8 @cederlys cederlys committed with Uwe Kleine-König Aug 24, 2010
Showing with 8 additions and 4 deletions.
  1. +8 −4 tg-depend.sh
View
@@ -43,10 +43,14 @@ branchrev="$(git rev-parse --verify "$name" 2>/dev/null)" ||
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

0 comments on commit bd0a68e

Please sign in to comment.