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

Fix broken worktree path with submodules on Windows#276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:masterfrommsiemens:patch-1
Apr 7, 2015
Merged

Fix broken worktree path with submodules on Windows#276

Byron merged 1 commit intogitpython-developers:masterfrommsiemens:patch-1
Apr 7, 2015

Conversation

msiemens
Copy link
Contributor

On Windows,repo.create_submodule(...) failed because git didn't recognize the worktree path set in.git/modules/sub/config (fatal: bad config file line 6 in ./config). This resulted in the following traceback:

Traceback (most recent call last):  File "F:\Dokumente\Coding\python\PyGitUp\tests\test_submodules.py", line 42, in setup    repo.create_submodule('sub', 'sub', master_path)  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\repo\base.py", line 295, in create_submodule    return Submodule.add(self, *args, **kwargs)  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\objects\submodule\base.py", line 417, in add    sm.binsha = mrepo.head.commit.binsha  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\refs\symbolic.py", line 182, in _get_commit    obj = self._get_object()  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\refs\symbolic.py", line 175, in _get_object    return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\objects\base.py", line 65, in new_from_sha    oinfo = repo.odb.info(sha1)  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\db.py", line 40, in info    hexsha, typename, size = self._git.get_object_header(bin_to_hex(sha))  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\cmd.py", line 866, in get_object_header    return self.__get_object_header(cmd, ref)  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\cmd.py", line 855, in __get_object_header    return self._parse_object_header(cmd.stdout.readline())  File "F:\Dokumente\Coding\python\.virtualenv\PyGitUp\lib\site-packages\git\cmd.py", line 817, in _parse_object_header    raise ValueError("SHA could not be resolved, git returned: %r" % (header_line.strip()))ValueError: SHA could not be resolved, git returned: ''

This PR makes_write_git_file_and_module_config convert the worktree path to the linux format (forward slashes) which git recognizes.

@msiemensmsiemens changed the titleFix problem with submodules on WindowsFix broken worktree path with submodules on WindowsApr 7, 2015
@ByronByron added this to thev0.3.7 - Fixes milestoneApr 7, 2015
@Byron
Copy link
Member

Thank you.
Would you mind fixing this issue reported byflake8 ?

$ flake8./git/objects/submodule/base.py:296:121: E501 line too long (123 > 120 characters)

Then I'd be glad to merge and release it this week. Thanks again.

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.
@msiemens
Copy link
ContributorAuthor

Sure! I've updated the PR now. The Travis tests failed, but it doesn't seem to be related to this change.

Byron added a commit that referenced this pull requestApr 7, 2015
Fix broken worktree path with submodules on Windows
@ByronByron merged commitc27cd90 intogitpython-developers:masterApr 7, 2015
@msiemensmsiemens deleted the patch-1 branchApril 7, 2015 13:47
@Byron
Copy link
Member

Indeed, the other travis issue will be on my plate.
Thank you !

@msiemens
Copy link
ContributorAuthor

That was quick! Thanks,@Byron!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
v0.3.7 - Fixes
Development

Successfully merging this pull request may close these issues.

2 participants
@msiemens@Byron

[8]ページ先頭

©2009-2025 Movatter.jp