| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,7 +45,7 @@ jobs: | |||
| 45 | 45 | - name: Install Cygwin | |
| 46 | 46 | uses: cygwin/cygwin-install-action@v6 | |
| 47 | 47 | with: | |
| 48 | - packages: git python39 python-pip-wheel python-setuptools-wheel python-wheel-wheel | ||
| 48 | + packages: curl git python39 python-setuptools-wheel | ||
| 49 | 49 | add-to-path: false # No need to change $PATH outside the Cygwin environment. | |
| 50 | 50 | ||
| 51 | 51 | - name: Arrange for verbose output | |
@@ -73,12 +73,15 @@ jobs: | |||
| 73 | 73 | ||
| 74 | 74 | - name: Set up virtual environment | |
| 75 | 75 | run: | | |
| 76 | + pip_wheel=/usr/share/python-wheels/pip-26.0.1-py3-none-any.whl | ||
| 77 | + curl -fsSLo "$pip_wheel" https://files.pythonhosted.org/packages/de/f0/c81e05b613866b76d2d1066490adf1a3dbc4ee9d9c839961c3fc8a6997af/pip-26.0.1-py3-none-any.whl | ||
| 78 | + python3.9 -c 'import hashlib, pathlib, sys; assert hashlib.sha256(pathlib.Path(sys.argv[1]).read_bytes()).hexdigest() == sys.argv[2]' "$pip_wheel" bdb1b08f4274833d62c1aa29e20907365a2ceb950410df15fc9521bad440122b | ||
| 76 | 79 | python3.9 -m venv .venv | |
| 77 | 80 | echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV" | |
| 78 | 81 | ||
| 79 | 82 | - name: Update PyPA packages | |
| 80 | 83 | run: | | |
| 81 | - python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel | ||
| 84 | + python -m pip install -U 'setuptools; python_version<"3.12"' wheel | ||
| 82 | 85 | ||
| 83 | 86 | - name: Install project and test dependencies | |
| 84 | 87 | run: | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -386,6 +386,10 @@ def __init__( | |||
| 386 | 386 | # Let's not assume the option exists, although it should. | |
| 387 | 387 | pass | |
| 388 | 388 | ||
| 389 | + # A linked worktree is not bare even when its main repository is. | ||
| 390 | + if self._bare and self._working_tree_dir and osp.isfile(osp.join(self.git_dir, "commondir")): | ||
| 391 | + self._bare = False | ||
| 392 | + | ||
| 389 | 393 | # Adjust the working directory in case we are actually bare - we didn't know | |
| 390 | 394 | # that in the first place. | |
| 391 | 395 | if self._bare: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1459,6 +1459,23 @@ def test_git_work_tree_dotgit(self, rw_dir, use_relative_paths=False): | |||
| 1459 | 1459 | ||
| 1460 | 1460 | self.assertIsInstance(repo.heads["aaaaaaaa"], Head) | |
| 1461 | 1461 | ||
| 1462 | + @with_rw_directory | ||
| 1463 | + def test_git_work_tree_from_bare_repo(self, rw_dir): | ||
| 1464 | + if Git().version_info[:3] < (2, 5, 1): | ||
| 1465 | + pytest.skip("worktree feature unsupported, needs git 2.5.1 or later") | ||
| 1466 | + | ||
| 1467 | + bare_repo = self.rorepo.clone(join_path_native(rw_dir, "bare_repo"), bare=True) | ||
| 1468 | + worktree_path = join_path_native(rw_dir, "worktree_repo") | ||
| 1469 | + if Git.is_cygwin(): | ||
| 1470 | + worktree_path = cygpath(worktree_path) | ||
| 1471 | + bare_repo.git.worktree("add", "--detach", worktree_path) | ||
| 1472 | + | ||
| 1473 | + repo = Repo(worktree_path) | ||
| 1474 | + | ||
| 1475 | + assert Git(worktree_path).rev_parse("--is-bare-repository") == "false" | ||
| 1476 | + assert not repo.bare | ||
| 1477 | + assert osp.samefile(repo.working_tree_dir, worktree_path) | ||
| 1478 | + | ||
| 1462 | 1479 | def test_git_work_tree_dotgit_relative(self): | |
| 1463 | 1480 | """Check that we find .git as a worktree file containing a relative path | |
| 1464 | 1481 | and find the worktree based on it.""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments