summaryrefslogtreecommitdiff
path: root/lib/git/cmd.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/cmd.py')
-rw-r--r--lib/git/cmd.py18
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)]