diff options
Diffstat (limited to 'git')
-rw-r--r-- | git/cmd.py | 1 | ||||
-rw-r--r-- | git/objects/submodule/base.py | 2 | ||||
-rw-r--r-- | git/objects/submodule/root.py | 2 | ||||
-rw-r--r-- | git/test/test_submodule.py | 2 | ||||
-rw-r--r-- | git/util.py | 3 |
5 files changed, 5 insertions, 5 deletions
@@ -135,6 +135,7 @@ def dict_to_slots_and__excluded_are_none(self, d, excluded=()): ## -- End Utilities -- @} + # value of Windows process creation flag taken from MSDN CREATE_NO_WINDOW = 0x08000000 diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index a35240f1..55e2ea27 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -540,7 +540,7 @@ class Submodule(IndexObject, Iterable, Traversable): # make sure HEAD is not detached mrepo.head.set_reference(local_branch, logmsg="submodule: attaching head to %s" % local_branch) mrepo.head.ref.set_tracking_branch(remote_branch) - except IndexError: + except (IndexError, InvalidGitRepositoryError): log.warn("Failed to checkout tracking branch %s", self.branch_path) # END handle tracking branch diff --git a/git/objects/submodule/root.py b/git/objects/submodule/root.py index 4fe856c2..fbd658d7 100644 --- a/git/objects/submodule/root.py +++ b/git/objects/submodule/root.py @@ -17,7 +17,6 @@ log.addHandler(logging.NullHandler()) class RootUpdateProgress(UpdateProgress): - """Utility class which adds more opcodes to the UpdateProgress""" REMOVE, PATHCHANGE, BRANCHCHANGE, URLCHANGE = [ 1 << x for x in range(UpdateProgress._num_op_codes, UpdateProgress._num_op_codes + 4)] @@ -25,6 +24,7 @@ class RootUpdateProgress(UpdateProgress): __slots__ = tuple() + BEGIN = RootUpdateProgress.BEGIN END = RootUpdateProgress.END REMOVE = RootUpdateProgress.REMOVE diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 59a40fa0..0a6c4880 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -32,12 +32,12 @@ import os.path as osp class TestRootProgress(RootUpdateProgress): - """Just prints messages, for now without checking the correctness of the states""" def update(self, op, cur_count, max_count, message=''): print(op, cur_count, max_count, message) + prog = TestRootProgress() diff --git a/git/util.py b/git/util.py index 6e3ddfab..1dbbd35d 100644 --- a/git/util.py +++ b/git/util.py @@ -3,8 +3,6 @@ # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -from __future__ import unicode_literals - import contextlib from functools import wraps import getpass @@ -947,6 +945,7 @@ class NullHandler(logging.Handler): def emit(self, record): pass + # In Python 2.6, there is no NullHandler yet. Let's monkey-patch it for a workaround. if not hasattr(logging, 'NullHandler'): logging.NullHandler = NullHandler |