Skip to content

Commit

Permalink
blergh
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Obrist committed Oct 31, 2011
1 parent b546a7b commit 51cfd6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stats/utils.py
Expand Up @@ -4,6 +4,7 @@
from dulwich.client import get_transport_and_path
from dulwich.repo import Repo
import os
import shutil
import sys

class Slugifier(object):
Expand Down Expand Up @@ -40,11 +41,10 @@ class MyModel(models.Model):

def update_git(repourl, repodir):
client, host_path = get_transport_and_path(repourl)
# todo: make fetch work
if os.path.exists(repodir):
repo = Repo(repodir)
else:
repo = Repo.init(repodir, mkdir=True)
shutil.rmtree(repodir)
repo = Repo.init(repodir, mkdir=True)
remote_refs = client.fetch(host_path, repo,
determine_wants=repo.object_store.determine_wants_all,
progress=sys.stdout.write)
repo["HEAD"] = remote_refs["HEAD"]

0 comments on commit 51cfd6a

Please sign in to comment.