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

Commita2cd130

Browse files
authored
Merge pull request#697 from cblegare/master
Remove trailing slash on drive path
2 parents28cbb95 +280e573 commita2cd130

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

‎AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ Contributors are:
2424
-Alexis Horgix Chotard
2525
-Piotr Babij <piotr.babij _at_ gmail.com>
2626
-Mikuláš Poul <mikulaspoul _at_ gmail.com>
27+
-Charles Bouchard-Légaré <cblegare.atl _at_ ntis.ca>
2728

2829
Portions derived from other open source works and are clearly marked.

‎git/objects/submodule/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def _to_relative_path(cls, parent_repo, path):
278278
ifnotpath.startswith(working_tree_linux):
279279
raiseValueError("Submodule checkout path '%s' needs to be within the parents repository at '%s'"
280280
% (working_tree_linux,path))
281-
path=path[len(working_tree_linux)+1:]
281+
path=path[len(working_tree_linux.rstrip('/'))+1:]
282282
ifnotpath:
283283
raiseValueError("Absolute submodule path '%s' didn't yield a valid relative path"%path)
284284
# end verify converted relative path makes sense

‎git/test/test_submodule.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
importgit
1212
fromgit.cmdimportGit
13-
fromgit.compatimportstring_types
13+
fromgit.compatimportstring_types,is_win
1414
fromgit.excimport (
1515
InvalidGitRepositoryError,
1616
RepositoryDirtyError
@@ -911,3 +911,13 @@ def test_branch_renames(self, rw_dir):
911911
parent_repo.submodule_update(to_latest_revision=True,force_reset=True)
912912
assertsm_mod.commit()==sm_pfb.commit,"Now head should have been reset"
913913
assertsm_mod.head.ref.name==sm_pfb.name
914+
915+
@skipIf(notis_win,"Specifically for Windows.")
916+
deftest_to_relative_path_with_super_at_root_drive(self):
917+
classRepo(object):
918+
working_tree_dir='D:\\'
919+
super_repo=Repo()
920+
submodule_path='D:\\submodule_path'
921+
relative_path=Submodule._to_relative_path(super_repo,submodule_path)
922+
msg='_to_relative_path should be "submodule_path" but was "%s"'%relative_path
923+
assertrelative_path=='submodule_path',msg

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp