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

Commit1c2502e

Browse files
committed
Fix problem with submodules on Windows
On Windows, `repo.create_submodule(...)` failed because git didn't recognizethe worktree path set in `.git/modules/sub/config` (`fatal: bad config fileline 6 in ./config`). This commit makes `_write_git_file_and_module_config`convert the worktree path to the linux format (forward slashes) which gitrecognizes.
1 parentbe81304 commit1c2502e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎git/objects/submodule/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ def _write_git_file_and_module_config(cls, working_tree_dir, module_abspath):
293293
fp.close()
294294

295295
writer=GitConfigParser(os.path.join(module_abspath,'config'),read_only=False,merge_includes=False)
296-
writer.set_value('core','worktree',os.path.relpath(working_tree_dir,start=module_abspath))
296+
writer.set_value('core','worktree',
297+
to_native_path_linux(os.path.relpath(working_tree_dir,start=module_abspath)))
297298
writer.release()
298299

299300
#{ Edit Interface

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp