def transform_kwargs(self, split_single_char_options=True, **kwargs): """Transforms Python style kwargs into git command line options.""" args = list() kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) for k, v in kwargs.items(): if isinstance(v, (list, tuple)): for value in v: args += self.transform_kwarg(k, value, split_single_char_options) else: args += self.transform_kwarg(k, v, split_single_char_options) return args