@@ -11,25 +11,25 @@ class Git(MethodMissingMixin):
1111 def __init__ (self , git_dir ):
1212 super (Git , self ).__init__ ()
1313 self .git_dir = git_dir
14-
14+
1515 git_binary = "/usr/bin/env git"
16-
16+
1717 @property
1818 def get_dir (self ):
1919 return self .git_dir
20-
20+
2121 def execute (self , command ):
2222 """
2323 Handles executing the command on the shell and consumes and returns
2424 the returned information (stdout)
25-
25+
2626 ``command``
2727 The command to execute
2828 """
2929 print command
30- proc = subprocess .Popen (command ,
30+ proc = subprocess .Popen (command ,
3131 shell = True ,
32- stdout = subprocess .PIPE
32+ stdout = subprocess .PIPE
3333 )
3434 stdout_value = proc .communicate ()[0 ]
3535 return stdout_value
@@ -51,31 +51,31 @@ def transform_kwargs(self, **kwargs):
5151 else :
5252 args .append ("--%s=%r" % (dashify (k ), v ))
5353 return args
54-
54+
5555 def method_missing (self , method , * args , ** kwargs ):
5656 """
5757 Run the given git command with the specified arguments and return
5858 the result as a String
59-
59+
6060 ``method``
6161 is the command
62-
62+
6363 ``args``
6464 is the list of arguments
65-
65+
6666 ``kwargs``
6767 is a dict of keyword arguments
6868
6969 Examples
7070 git.rev_list('master', max_count=10, header=True)
71-
71+
7272 Returns
7373 str
7474 """
7575 opt_args = self .transform_kwargs (** kwargs )
7676 ext_args = map (lambda a : (a == '--' ) and a or "%s" % shell_escape (a ), args )
7777 args = opt_args + ext_args
78-
78+
7979 call = "%s --git-dir=%s %s %s" % (self .git_binary , self .git_dir , dashify (method ), ' ' .join (args ))
8080 stdout_value = self .execute (call )
8181 return stdout_value
0 commit comments