From 0ef12ae4c158fa8ddb78a70dcf8f90966758db81 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Fri, 28 Jul 2017 14:08:56 -0400 Subject: FetchInfo.re_fetch_result has no reason to be public And when using the API interactively, having it show up as public is confusing. --- git/remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index fd76e592..b058b3d4 100644 --- a/git/remote.py +++ b/git/remote.py @@ -208,7 +208,7 @@ class FetchInfo(object): NEW_TAG, NEW_HEAD, HEAD_UPTODATE, TAG_UPDATE, REJECTED, FORCED_UPDATE, \ FAST_FORWARD, ERROR = [1 << x for x in range(8)] - re_fetch_result = re.compile(r'^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?') + _re_fetch_result = re.compile(r'^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?') _flag_map = {'!': ERROR, '+': FORCED_UPDATE, @@ -263,7 +263,7 @@ class FetchInfo(object): fetch line is the corresponding line from FETCH_HEAD, like acb0fa8b94ef421ad60c8507b634759a472cd56c not-for-merge branch '0.1.7RC' of /tmp/tmpya0vairemote_repo""" - match = cls.re_fetch_result.match(line) + match = cls._re_fetch_result.match(line) if match is None: raise ValueError("Failed to parse line: %r" % line) -- cgit v1.2.1 From d1c40f46bd547be663b4cd97a80704279708ea8a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 3 Aug 2017 17:33:07 -0400 Subject: worktrees: make non-packed refs also work correctly. Turns out aec58a9 did the right thing for /packed/ refs, but didn't work correctly on /unpacked/ refs. So this patch gives unpacked refs the same treatment. Without the fix here, the test added will cause this traceback: ====================================================================== ERROR: Check that we find .git as a worktree file and find the worktree ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pjones/devel/github.com/GitPython/git/test/lib/helper.py", line 92, in wrapper return func(self, path) File "/home/pjones/devel/github.com/GitPython/git/test/test_repo.py", line 938, in test_git_work_tree_dotgit self.assertIsInstance(repo.heads['aaaaaaaa'], Head) File "/home/pjones/devel/github.com/GitPython/git/util.py", line 893, in __getitem__ raise IndexError("No item found with id %r" % (self._prefix + index)) IndexError: No item found with id 'aaaaaaaa' Woops. Things I've learned: - test_remote doesn't work currently if you start on a branch. I think it never did? - Because of 346424da, all *sorts* of stuff in the test suite doesn't work if you name your development branch "packed-refs" (This seems like a bug...) Signed-off-by: Peter Jones --- git/remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index fd76e592..29c7ed92 100644 --- a/git/remote.py +++ b/git/remote.py @@ -652,7 +652,7 @@ class Remote(LazyMixin, Iterable): continue # read head information - with open(osp.join(self.repo.git_dir, 'FETCH_HEAD'), 'rb') as fp: + with open(osp.join(self.repo.common_dir, 'FETCH_HEAD'), 'rb') as fp: fetch_head_info = [l.decode(defenc) for l in fp.readlines()] l_fil = len(fetch_info_lines) -- cgit v1.2.1 From 2b3c16c39953e7a6f55379403ca5d204dcbdb1e7 Mon Sep 17 00:00:00 2001 From: Benjamin Poldrack Date: Thu, 31 Aug 2017 02:35:36 +0200 Subject: BF: Added missing NullHandler to logger in git.remote --- git/remote.py | 1 + 1 file changed, 1 insertion(+) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index fd76e592..c3a51744 100644 --- a/git/remote.py +++ b/git/remote.py @@ -38,6 +38,7 @@ from .refs import ( log = logging.getLogger('git.remote') +log.addHandler(logging.NullHandler()) __all__ = ('RemoteProgress', 'PushInfo', 'FetchInfo', 'Remote') -- cgit v1.2.1