From 2da2b90e6930023ec5739ae0b714bbdb30874583 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 15 Oct 2009 12:09:16 +0200 Subject: repo: removed a few methods because of redundancy or because it will be obsolete once the interface overhaul is finished. This commit is just intermediate --- lib/git/cmd.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lib/git/cmd.py') diff --git a/lib/git/cmd.py b/lib/git/cmd.py index 2965eb8b..ef7a9c6c 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -223,6 +223,21 @@ class Git(object): args.append("--%s=%s" % (dashify(k), v)) return args + @classmethod + def __unpack_args(cls, arg_list): + if not isinstance(arg_list, (list,tuple)): + return [ str(arg_list) ] + + outlist = list() + for arg in arg_list: + if isinstance(arg_list, (list, tuple)): + outlist.extend(cls.__unpack_args( arg )) + # END recursion + else: + outlist.append(str(arg)) + # END for each arg + return outlist + def _call_process(self, method, *args, **kwargs): """ Run the given git command with the specified arguments and return @@ -258,7 +273,8 @@ class Git(object): # Prepare the argument list opt_args = self.transform_kwargs(**kwargs) - ext_args = map(str, args) + + ext_args = self.__unpack_args(args) args = opt_args + ext_args call = ["git", dashify(method)] -- cgit v1.2.1