Mercurial > hg > hg-git
changeset 612:60a4d55fdaa6
Merge a work-around for a bug in dulwich.
I've been waiting for dulwich upstream to fix this *and* for a test
from domruf that's acceptable. Having gotten neither over a period of
/months/, and having hit the bug myself, I'm moving on and accepting a
patch without tests. This will likely break again, but hopefully
before we'd break it dulwich will be fixed.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Tue, 17 Sep 2013 09:59:36 -0400 |
parents | 30d502905da9 (diff) 681298a09daf (current diff) |
children | bf8518b09d57 |
files | hggit/git_handler.py |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -1007,19 +1007,19 @@ if not ref.endswith('^{}') and ( ref.startswith('refs/heads/') or ref.startswith('refs/tags/') ) ] want = [x for x in want if x not in self.git] + return want - f, commit = self.git.object_store.add_pack() try: - try: - progress = GitProgress(self.ui) - ret = client.fetch_pack(path, determine_wants, graphwalker, - f.write, progress.progress) - progress.flush() - return ret - except (HangupException, GitProtocolError), e: - raise hgutil.Abort(_("git remote error: ") + str(e)) - finally: - commit() + progress = GitProgress(self.ui) + f = StringIO.StringIO() + ret = client.fetch_pack(path, determine_wants, graphwalker, f.write, progress.progress) + if(f.pos != 0): + f.seek(0) + po = self.git.object_store.add_thin_pack(f.read, None) + progress.flush() + return ret + except (HangupException, GitProtocolError), e: + raise hgutil.Abort(_("git remote error: ") + str(e)) ## REFERENCES HANDLING