git checkout doesn't require explicit branch parameter
authorTimo Savola <tsavola@movial.fi>
Fri, 4 Apr 2008 13:36:45 +0000 (16:36 +0300)
committerTimo Savola <tsavola@movial.fi>
Fri, 4 Apr 2008 13:36:45 +0000 (16:36 +0300)
matrix/git.py

index 3f0f88e4a26ca5f0c469ca75fcf00e4977615470..9a53d0f4e2fdb53814946c459b1362cc5eb6f954 100644 (file)
@@ -156,8 +156,12 @@ def delete_branch(name, branch, force=False, quiet=False):
 
        return call(['branch', command, branch], name, quiet, not quiet) == 0
 
-def checkout(name, branch):
-       call(['checkout', branch], workdir=name, fail=True)
+def checkout(name, branch=None):
+       cmd = ['checkout']
+       if branch:
+               cmd.append(branch)
+
+       call(cmd, workdir=name, fail=True)
 
 def rev_parse(name, arg):
        lines = call_output(['rev-parse', arg], workdir=name)