diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-15 12:09:16 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-15 12:09:29 +0200 |
commit | 2da2b90e6930023ec5739ae0b714bbdb30874583 (patch) | |
tree | 506303c27732783c4a06cfd4fe8cf62d63bd42e7 /lib/git/cmd.py | |
parent | 58d692e2a1d7e3894dbed68efbcf7166d6ec3fb7 (diff) | |
download | gitpython-2da2b90e6930023ec5739ae0b714bbdb30874583.tar.gz |
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
Diffstat (limited to 'lib/git/cmd.py')
-rw-r--r-- | lib/git/cmd.py | 18 |
1 files changed, 17 insertions, 1 deletions
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)] |