Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc3c6c81

Browse files
committed
Merge branch 'issue-232-reproduction' - keep fetch/pull simplifications
Make sure we keep the improvements made to fetch and pullRelates togitpython-developers#232
2 parents47ac37b +0ed61f7 commitc3c6c81

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎git/remote.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ def _get_fetch_info_from_stderr(self, proc, progress):
523523

524524
progress_handler=progress.new_message_handler()
525525

526-
defmy_progress_handler(line):
526+
forlineinproc.stderr:
527+
line=line.decode(defenc)
528+
line=line.rstrip()
527529
forplineinprogress_handler(line):
528530
ifline.startswith('fatal:'):
529531
raiseGitCommandError(("Error when fetching: %s"%line,),2)
@@ -538,7 +540,7 @@ def my_progress_handler(line):
538540
# end
539541

540542
# We are only interested in stderr here ...
541-
handle_process_output(proc,None,my_progress_handler,finalize_process)
543+
finalize_process(proc)
542544

543545
# read head information
544546
fp=open(join(self.repo.git_dir,'FETCH_HEAD'),'rb')
@@ -608,6 +610,7 @@ def fetch(self, refspec=None, progress=None, **kwargs):
608610
args= [refspec]
609611

610612
proc=self.repo.git.fetch(self,*args,with_extended_output=True,as_process=True,v=True,**kwargs)
613+
proc.stdout.close()
611614
res=self._get_fetch_info_from_stderr(proc,progressorRemoteProgress())
612615
ifhasattr(self.repo.odb,'update_cache'):
613616
self.repo.odb.update_cache()
@@ -623,6 +626,7 @@ def pull(self, refspec=None, progress=None, **kwargs):
623626
:return: Please see 'fetch' method """
624627
kwargs=add_progress(kwargs,self.repo.git,progress)
625628
proc=self.repo.git.pull(self,refspec,with_extended_output=True,as_process=True,v=True,**kwargs)
629+
proc.stdout.close()
626630
res=self._get_fetch_info_from_stderr(proc,progressorRemoteProgress())
627631
ifhasattr(self.repo.odb,'update_cache'):
628632
self.repo.odb.update_cache()

‎git/test/test_remote.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ def _assert_push_and_pull(self, remote, rw_repo, remote_repo):
348348
new_head=Head.create(rw_repo,"my_new_branch")
349349
progress=TestRemoteProgress()
350350
res=remote.push(new_head,progress)
351+
assertlen(res)>0
351352
assertres[0].flags&PushInfo.NEW_HEAD
352353
progress.make_assertion()
353354
self._do_test_push_result(res,remote)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp