Title: Fix broken worktree path with submodules on Windows by msiemens · Pull Request #276 · gitpython-developers/GitPython · GitHub
Open Graph Title: Fix broken worktree path with submodules on Windows by msiemens · Pull Request #276 · gitpython-developers/GitPython
X Title: Fix broken worktree path with submodules on Windows by msiemens · Pull Request #276 · gitpython-developers/GitPython
Description: 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.
Open Graph Description: 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 fol...
X Description: 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...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/276
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0c0b61a3-71cd-1a2d-55e4-7ff5a8200d58 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C650:34DB8F:96AE38:CACFB2:6B00EBEE |
| html-safe-nonce | 8aa135f3d30eb670fe2e8c63fc98ca31f43954fbe8edd1f7c3e1e281b44a0505 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjUwOjM0REI4Rjo5NkFFMzg6Q0FDRkIyOjZCMDBFQkVFIiwidmlzaXRvcl9pZCI6IjM4MTY4NjY2MjY2MjQ2MTMzNTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e7242ee8524ba7e66ae031e3c2b8d7253a59824aabc6b7ad79a9e58d710d2ff0 |
| hovercard-subject-tag | pull_request:32759343 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/276/files |
| twitter:image | https://avatars.githubusercontent.com/u/1873922?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1873922?s=400&v=4 |
| og:image:alt | 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 fol... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width