public
Description: Python interface for talking to the github API
Clone URL: git://github.com/dustin/py-github.git
Always do a fetch (even after a clone).  Keeps the branches in sync.
dustin (author)
Sun Apr 20 00:51:14 -0700 2008
commit  303d34dfa68167c2cd881aa17c90c833b6dad649
tree    fb901c6e4107fb1c78050d8b21f4d25efedada40
parent  f580b793ad74da3338e62ba16d30d986e95dcbc1
...
14
15
16
17
18
19
 
20
21
22
23
 
24
25
26
...
14
15
16
 
 
 
17
18
19
20
21
22
23
24
25
0
@@ -14,13 +14,12 @@ import github
0
 def sync(path, user, repo):
0
     p=os.path.join(path, repo.name) + ".git"
0
     print "Syncing %s -> %s" % (repo, p)
0
- if os.path.exists(p):
0
- subprocess.call(['git', '--git-dir=' + p, 'fetch', '-f'])
0
- else:
0
+ if not os.path.exists(p):
0
         url = "git://github.com/%s/%s" % (user.login, repo.name)
0
         subprocess.call(['git', 'clone', '--bare', url, p])
0
         subprocess.call(['git', '--git-dir=' + p, 'remote', 'add', 'origin',
0
             url])
0
+ subprocess.call(['git', '--git-dir=' + p, 'fetch', '-f'])
0
 
0
 def usage():
0
     sys.stderr.write("Usage: %s username destination_url\n" % sys.argv[0])

Comments

    No one has commented yet.