diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2017-11-19 16:03:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-19 16:03:37 +0100 |
commit | a2cd130bed184fe761105d60edda6936f348edc6 (patch) | |
tree | 3e463012cf8fa4bd540e558f2f84f386a244b0a5 /git/test/test_submodule.py | |
parent | 28cbb953ce01b4eea7f096c28f84da1fbab26694 (diff) | |
parent | 280e573beb90616fe9cb0128cec47b3aff69b86a (diff) | |
download | gitpython-a2cd130bed184fe761105d60edda6936f348edc6.tar.gz |
Merge pull request #697 from cblegare/master
Remove trailing slash on drive path
Diffstat (limited to 'git/test/test_submodule.py')
-rw-r--r-- | git/test/test_submodule.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index e667ae17..f970dd2c 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -10,7 +10,7 @@ except ImportError: import git from git.cmd import Git -from git.compat import string_types +from git.compat import string_types, is_win from git.exc import ( InvalidGitRepositoryError, RepositoryDirtyError @@ -911,3 +911,13 @@ class TestSubmodule(TestBase): parent_repo.submodule_update(to_latest_revision=True, force_reset=True) assert sm_mod.commit() == sm_pfb.commit, "Now head should have been reset" assert sm_mod.head.ref.name == sm_pfb.name + + @skipIf(not is_win, "Specifically for Windows.") + def test_to_relative_path_with_super_at_root_drive(self): + class Repo(object): + working_tree_dir = 'D:\\' + super_repo = Repo() + submodule_path = 'D:\\submodule_path' + relative_path = Submodule._to_relative_path(super_repo, submodule_path) + msg = '_to_relative_path should be "submodule_path" but was "%s"' % relative_path + assert relative_path == 'submodule_path', msg
\ No newline at end of file |