diff -Nru python-git-2.1.10/AUTHORS python-git-2.1.11/AUTHORS --- python-git-2.1.10/AUTHORS 2017-12-11 14:24:45.000000000 +0000 +++ python-git-2.1.11/AUTHORS 2018-07-15 12:44:37.000000000 +0000 @@ -26,5 +26,6 @@ -Mikuláš Poul -Charles Bouchard-Légaré -Yaroslav Halchenko +-Tim Swast Portions derived from other open source works and are clearly marked. diff -Nru python-git-2.1.10/debian/changelog python-git-2.1.11/debian/changelog --- python-git-2.1.10/debian/changelog 2018-07-06 08:40:17.000000000 +0000 +++ python-git-2.1.11/debian/changelog 2018-07-30 02:45:18.000000000 +0000 @@ -1,3 +1,9 @@ +python-git (2.1.11-1) unstable; urgency=medium + + * New upstream version 2.1.11 + + -- TANIGUCHI Takaki Mon, 30 Jul 2018 11:45:18 +0900 + python-git (2.1.10-1) unstable; urgency=medium * Bump Stanrads-Version to 4.1.5. diff -Nru python-git-2.1.10/doc/source/changes.rst python-git-2.1.11/doc/source/changes.rst --- python-git-2.1.10/doc/source/changes.rst 2018-05-19 08:53:33.000000000 +0000 +++ python-git-2.1.11/doc/source/changes.rst 2018-07-15 13:35:23.000000000 +0000 @@ -2,6 +2,15 @@ Changelog ========= +2.1.11 - Bugfixes +================= + +see the following for (most) details: +https://github.com/gitpython-developers/gitpython/milestone/26?closed=1 + +or run have a look at the difference between tags v2.1.10 and v2.1.11: +https://github.com/gitpython-developers/GitPython/compare/2.1.10...2.1.11 + 2.1.10 - Bugfixes ================= diff -Nru python-git-2.1.10/doc/source/tutorial.rst python-git-2.1.11/doc/source/tutorial.rst --- python-git-2.1.10/doc/source/tutorial.rst 2016-10-09 09:24:43.000000000 +0000 +++ python-git-2.1.11/doc/source/tutorial.rst 2018-07-15 12:44:37.000000000 +0000 @@ -19,6 +19,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [1-test_init_repo_object] :end-before: # ![1-test_init_repo_object] @@ -26,6 +27,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [2-test_init_repo_object] :end-before: # ![2-test_init_repo_object] @@ -33,6 +35,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [3-test_init_repo_object] :end-before: # ![3-test_init_repo_object] @@ -40,6 +43,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [4-test_init_repo_object] :end-before: # ![4-test_init_repo_object] @@ -47,6 +51,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [5-test_init_repo_object] :end-before: # ![5-test_init_repo_object] @@ -54,6 +59,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [6-test_init_repo_object] :end-before: # ![6-test_init_repo_object] @@ -66,6 +72,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [7-test_init_repo_object] :end-before: # ![7-test_init_repo_object] @@ -73,6 +80,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [8-test_init_repo_object] :end-before: # ![8-test_init_repo_object] @@ -80,6 +88,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [9-test_init_repo_object] :end-before: # ![9-test_init_repo_object] @@ -87,6 +96,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [10-test_init_repo_object] :end-before: # ![10-test_init_repo_object] @@ -94,6 +104,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [11-test_init_repo_object] :end-before: # ![11-test_init_repo_object] @@ -101,6 +112,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [12-test_init_repo_object] :end-before: # ![12-test_init_repo_object] @@ -108,6 +120,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [13-test_init_repo_object] :end-before: # ![13-test_init_repo_object] @@ -115,6 +128,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [14-test_init_repo_object] :end-before: # ![14-test_init_repo_object] @@ -126,6 +140,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [1-test_references_and_objects] :end-before: # ![1-test_references_and_objects] @@ -133,6 +148,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [2-test_references_and_objects] :end-before: # ![2-test_references_and_objects] @@ -140,6 +156,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [3-test_references_and_objects] :end-before: # ![3-test_references_and_objects] @@ -147,6 +164,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [4-test_references_and_objects] :end-before: # ![4-test_references_and_objects] @@ -156,6 +174,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [5-test_references_and_objects] :end-before: # ![5-test_references_and_objects] @@ -163,6 +182,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [6-test_references_and_objects] :end-before: # ![6-test_references_and_objects] @@ -170,6 +190,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [7-test_references_and_objects] :end-before: # ![7-test_references_and_objects] @@ -183,6 +204,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [8-test_references_and_objects] :end-before: # ![8-test_references_and_objects] @@ -190,6 +212,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [9-test_references_and_objects] :end-before: # ![9-test_references_and_objects] @@ -197,6 +220,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [10-test_references_and_objects] :end-before: # ![10-test_references_and_objects] @@ -204,6 +228,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [11-test_references_and_objects] :end-before: # ![11-test_references_and_objects] @@ -217,6 +242,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [12-test_references_and_objects] :end-before: # ![12-test_references_and_objects] @@ -224,6 +250,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [13-test_references_and_objects] :end-before: # ![13-test_references_and_objects] @@ -231,6 +258,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [14-test_references_and_objects] :end-before: # ![14-test_references_and_objects] @@ -238,6 +266,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [15-test_references_and_objects] :end-before: # ![15-test_references_and_objects] @@ -245,6 +274,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [16-test_references_and_objects] :end-before: # ![16-test_references_and_objects] @@ -257,6 +287,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [17-test_references_and_objects] :end-before: # ![17-test_references_and_objects] @@ -264,6 +295,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [18-test_references_and_objects] :end-before: # ![18-test_references_and_objects] @@ -271,6 +303,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [19-test_references_and_objects] :end-before: # ![19-test_references_and_objects] @@ -278,6 +311,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [20-test_references_and_objects] :end-before: # ![20-test_references_and_objects] @@ -285,6 +319,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [21-test_references_and_objects] :end-before: # ![21-test_references_and_objects] @@ -292,6 +327,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [22-test_references_and_objects] :end-before: # ![22-test_references_and_objects] @@ -304,6 +340,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [23-test_references_and_objects] :end-before: # ![23-test_references_and_objects] @@ -311,6 +348,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [24-test_references_and_objects] :end-before: # ![24-test_references_and_objects] @@ -321,6 +359,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [25-test_references_and_objects] :end-before: # ![25-test_references_and_objects] @@ -328,6 +367,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [26-test_references_and_objects] :end-before: # ![26-test_references_and_objects] @@ -343,7 +383,9 @@ with repo.git.custom_environment(GIT_SSH=ssh_executable): repo.remotes.origin.fetch() -Here's an example executable that can be used in place of the `ssh_executable` above:: +Here's an example executable that can be used in place of the `ssh_executable` above: + +.. code-block:: shell #!/bin/sh ID_RSA=/var/lib/openshift/5562b947ecdd5ce939000038/app-deployments/id_rsa @@ -359,6 +401,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [1-test_submodules] :end-before: # ![1-test_submodules] @@ -383,6 +426,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [27-test_references_and_objects] :end-before: # ![27-test_references_and_objects] @@ -390,6 +434,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [28-test_references_and_objects] :end-before: # ![28-test_references_and_objects] @@ -413,6 +458,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [29-test_references_and_objects] :end-before: # ![29-test_references_and_objects] @@ -420,6 +466,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [30-test_references_and_objects] :end-before: # ![30-test_references_and_objects] @@ -430,6 +477,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: def test_add_file_and_commit :end-before: # ![test_add_file_and_commit] @@ -441,6 +489,7 @@ .. literalinclude:: ../../git/test/test_docs.py :language: python + :dedent: 8 :start-after: # [31-test_references_and_objects] :end-before: # ![31-test_references_and_objects] diff -Nru python-git-2.1.10/git/__init__.py python-git-2.1.11/git/__init__.py --- python-git-2.1.10/git/__init__.py 2018-05-19 08:56:32.000000000 +0000 +++ python-git-2.1.11/git/__init__.py 2018-07-15 13:37:41.000000000 +0000 @@ -12,13 +12,13 @@ import os.path as osp -__version__ = '2.1.10' +__version__ = '2.1.11' #{ Initialization def _init_externals(): """Initialize external projects by putting them into the path""" - if __version__ == '2.1.10': + if __version__ == '2.1.11': sys.path.insert(0, osp.join(osp.dirname(__file__), 'ext', 'gitdb')) try: @@ -79,5 +79,8 @@ #} END initialize git executable path ################# -refresh() +try: + refresh() +except Exception as exc: + raise ImportError('Failed to initialize: {0}'.format(exc)) ################# diff -Nru python-git-2.1.10/git/repo/base.py python-git-2.1.11/git/repo/base.py --- python-git-2.1.10/git/repo/base.py 2018-03-24 12:45:37.000000000 +0000 +++ python-git-2.1.11/git/repo/base.py 2018-07-15 12:44:37.000000000 +0000 @@ -36,6 +36,11 @@ import gc import gitdb +try: + import pathlib +except ImportError: + pathlib = None + log = logging.getLogger(__name__) @@ -116,6 +121,8 @@ epath = decygpath(epath) epath = epath or path or os.getcwd() + if not isinstance(epath, str): + epath = str(epath) if expand_vars and ("%" in epath or "$" in epath): warnings.warn("The use of environment variables in paths is deprecated" + "\nfor security reasons and may be removed in the future!!") @@ -424,8 +431,7 @@ :param config_level: For possible values, see config_writer method If None, all applicable levels will be used. Specify a level in case - you know which exact file you whish to read to prevent reading multiple files for - instance + you know which file you wish to read to prevent reading multiple files. :note: On windows, system configuration cannot currently be read as the path is unknown, instead the global path will be used.""" files = None diff -Nru python-git-2.1.10/git/test/test_docs.py python-git-2.1.11/git/test/test_docs.py --- python-git-2.1.10/git/test/test_docs.py 2018-03-24 12:45:37.000000000 +0000 +++ python-git-2.1.11/git/test/test_docs.py 2018-07-15 12:44:37.000000000 +0000 @@ -9,7 +9,7 @@ from git.test.lib import TestBase from git.test.lib.helper import with_rw_directory -import os.path as osp +import os.path class Tutorials(TestBase): @@ -25,7 +25,6 @@ def test_init_repo_object(self, rw_dir): # [1-test_init_repo_object] from git import Repo - join = osp.join # rorepo is a Repo instance pointing to the git-python repository. # For all you know, the first argument to Repo is a path to the repository @@ -35,7 +34,7 @@ # ![1-test_init_repo_object] # [2-test_init_repo_object] - bare_repo = Repo.init(join(rw_dir, 'bare-repo'), bare=True) + bare_repo = Repo.init(os.path.join(rw_dir, 'bare-repo'), bare=True) assert bare_repo.bare # ![2-test_init_repo_object] @@ -52,19 +51,19 @@ # ![4-test_init_repo_object] # [5-test_init_repo_object] - cloned_repo = repo.clone(join(rw_dir, 'to/this/path')) + cloned_repo = repo.clone(os.path.join(rw_dir, 'to/this/path')) assert cloned_repo.__class__ is Repo # clone an existing repository - assert Repo.init(join(rw_dir, 'path/for/new/repo')).__class__ is Repo + assert Repo.init(os.path.join(rw_dir, 'path/for/new/repo')).__class__ is Repo # ![5-test_init_repo_object] # [6-test_init_repo_object] - with open(join(rw_dir, 'repo.tar'), 'wb') as fp: + with open(os.path.join(rw_dir, 'repo.tar'), 'wb') as fp: repo.archive(fp) # ![6-test_init_repo_object] # repository paths # [7-test_init_repo_object] - assert osp.isdir(cloned_repo.working_tree_dir) # directory with your work files + assert os.path.isdir(cloned_repo.working_tree_dir) # directory with your work files assert cloned_repo.git_dir.startswith(cloned_repo.working_tree_dir) # directory containing the git repository assert bare_repo.working_tree_dir is None # bare repositories have no working tree # ![7-test_init_repo_object] @@ -148,7 +147,7 @@ self.assertEqual(new_branch.checkout(), cloned_repo.active_branch) # checking out branch adjusts the wtree self.assertEqual(new_branch.commit, past.commit) # Now the past is checked out - new_file_path = osp.join(cloned_repo.working_tree_dir, 'my-new-file') + new_file_path = os.path.join(cloned_repo.working_tree_dir, 'my-new-file') open(new_file_path, 'wb').close() # create new file in working tree cloned_repo.index.add([new_file_path]) # add it to the index # Commit the changes to deviate masters history @@ -164,7 +163,7 @@ # now new_branch is ahead of master, which probably should be checked out and reset softly. # note that all these operations didn't touch the working tree, as we managed it ourselves. # This definitely requires you to know what you are doing :) ! - assert osp.basename(new_file_path) in new_branch.commit.tree # new file is now in tree + assert os.path.basename(new_file_path) in new_branch.commit.tree # new file is now in tree master.commit = new_branch.commit # let master point to most recent commit cloned_repo.head.reference = master # we adjusted just the reference, not the working tree or index # ![13-test_init_repo_object] @@ -194,7 +193,7 @@ def test_references_and_objects(self, rw_dir): # [1-test_references_and_objects] import git - repo = git.Repo.clone_from(self._small_repo_url(), osp.join(rw_dir, 'repo'), branch='master') + repo = git.Repo.clone_from(self._small_repo_url(), os.path.join(rw_dir, 'repo'), branch='master') heads = repo.heads master = heads.master # lists can be accessed by name for convenience @@ -266,7 +265,7 @@ # [11-test_references_and_objects] hct.blobs[0].data_stream.read() # stream object to read data from - hct.blobs[0].stream_data(open(osp.join(rw_dir, 'blob_data'), 'wb')) # write data to given stream + hct.blobs[0].stream_data(open(os.path.join(rw_dir, 'blob_data'), 'wb')) # write data to given stream # ![11-test_references_and_objects] # [12-test_references_and_objects] @@ -352,11 +351,11 @@ # Access blob objects for (path, stage), entry in index.entries.items(): # @UnusedVariable pass - new_file_path = osp.join(repo.working_tree_dir, 'new-file-name') + new_file_path = os.path.join(repo.working_tree_dir, 'new-file-name') open(new_file_path, 'w').close() index.add([new_file_path]) # add a new file to the index index.remove(['LICENSE']) # remove an existing one - assert osp.isfile(osp.join(repo.working_tree_dir, 'LICENSE')) # working tree is untouched + assert os.path.isfile(os.path.join(repo.working_tree_dir, 'LICENSE')) # working tree is untouched self.assertEqual(index.commit("my commit message").type, 'commit') # commit changed index repo.active_branch.commit = repo.commit('HEAD~1') # forget last commit @@ -375,11 +374,11 @@ # merge two trees three-way into memory merge_index = IndexFile.from_tree(repo, 'HEAD~10', 'HEAD', repo.merge_base('HEAD~10', 'HEAD')) # and persist it - merge_index.write(osp.join(rw_dir, 'merged_index')) + merge_index.write(os.path.join(rw_dir, 'merged_index')) # ![24-test_references_and_objects] # [25-test_references_and_objects] - empty_repo = git.Repo.init(osp.join(rw_dir, 'empty')) + empty_repo = git.Repo.init(os.path.join(rw_dir, 'empty')) origin = empty_repo.create_remote('origin', repo.remotes.origin.url) assert origin.exists() assert origin == empty_repo.remotes.origin == empty_repo.remotes['origin'] @@ -482,8 +481,8 @@ def test_add_file_and_commit(self, rw_dir): import git - repo_dir = osp.join(rw_dir, 'my-new-repo') - file_name = osp.join(repo_dir, 'new-file') + repo_dir = os.path.join(rw_dir, 'my-new-repo') + file_name = os.path.join(repo_dir, 'new-file') r = git.Repo.init(repo_dir) # This function just creates an empty file ... diff -Nru python-git-2.1.10/git/test/test_repo.py python-git-2.1.11/git/test/test_repo.py --- python-git-2.1.10/git/test/test_repo.py 2018-05-19 08:49:48.000000000 +0000 +++ python-git-2.1.11/git/test/test_repo.py 2018-07-15 12:44:37.000000000 +0000 @@ -110,6 +110,14 @@ assert not rw_repo.git.working_dir.endswith('.git') self.assertEqual(r_from_gitdir.git.working_dir, rw_repo.git.working_dir) + @with_rw_repo('0.3.2.1') + def test_repo_creation_pathlib(self, rw_repo): + if pathlib is None: # pythons bellow 3.4 don't have pathlib + raise SkipTest("pathlib was introduced in 3.4") + + r_from_gitdir = Repo(pathlib.Path(rw_repo.git_dir)) + self.assertEqual(r_from_gitdir.git_dir, rw_repo.git_dir) + def test_description(self): txt = "Test repository" self.rorepo.description = txt diff -Nru python-git-2.1.10/GitPython.egg-info/PKG-INFO python-git-2.1.11/GitPython.egg-info/PKG-INFO --- python-git-2.1.10/GitPython.egg-info/PKG-INFO 2018-05-19 08:56:32.000000000 +0000 +++ python-git-2.1.11/GitPython.egg-info/PKG-INFO 2018-07-15 13:37:40.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: GitPython -Version: 2.1.10 +Version: 2.1.11 Summary: Python Git Library Home-page: https://github.com/gitpython-developers/GitPython Author: Sebastian Thiel, Michael Trier diff -Nru python-git-2.1.10/PKG-INFO python-git-2.1.11/PKG-INFO --- python-git-2.1.10/PKG-INFO 2018-05-19 08:56:32.000000000 +0000 +++ python-git-2.1.11/PKG-INFO 2018-07-15 13:37:41.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: GitPython -Version: 2.1.10 +Version: 2.1.11 Summary: Python Git Library Home-page: https://github.com/gitpython-developers/GitPython Author: Sebastian Thiel, Michael Trier diff -Nru python-git-2.1.10/VERSION python-git-2.1.11/VERSION --- python-git-2.1.10/VERSION 2018-05-19 08:50:49.000000000 +0000 +++ python-git-2.1.11/VERSION 2018-07-15 13:33:13.000000000 +0000 @@ -1 +1 @@ -2.1.10 +2.1.11