| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2fd79f4 commit 6e477e3
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,11 +8,10 @@ | |||
| 8 | 8 | ||
| 9 | 9 | import pytest | |
| 10 | 10 | ||
| 11 | + from git.exc import GitCommandError | ||
| 11 | 12 | from test.lib import TestBase | |
| 12 | 13 | from test.lib.helper import with_rw_directory | |
| 13 | 14 | ||
| 14 | - import os.path | ||
| 15 | - | ||
| 16 | 15 | ||
| 17 | 16 | class Tutorials(TestBase): | |
| 18 | 17 | def tearDown(self): | |
@@ -207,6 +206,14 @@ def update(self, op_code, cur_count, max_count=None, message=""): | |||
| 207 | 206 | assert sm.module_exists() # The submodule's working tree was checked out by update. | |
| 208 | 207 | # ![14-test_init_repo_object] | |
| 209 | 208 | ||
| 209 | + @pytest.mark.xfail( | ||
| 210 | + os.name == "nt", | ||
| 211 | + reason=( | ||
| 212 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 213 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 214 | + ), | ||
| 215 | + raises=GitCommandError, | ||
| 216 | + ) | ||
| 210 | 217 | @with_rw_directory | |
| 211 | 218 | def test_references_and_objects(self, rw_dir): | |
| 212 | 219 | # [1-test_references_and_objects] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,10 +3,13 @@ | |||
| 3 | 3 | ||
| 4 | 4 | from io import BytesIO | |
| 5 | 5 | from stat import S_IFDIR, S_IFREG, S_IFLNK, S_IXUSR | |
| 6 | - from os import stat | ||
| 6 | + import os | ||
| 7 | 7 | import os.path as osp | |
| 8 | 8 | ||
| 9 | + import pytest | ||
| 10 | + | ||
| 9 | 11 | from git import Git | |
| 12 | + from git.exc import GitCommandError | ||
| 10 | 13 | from git.index import IndexFile | |
| 11 | 14 | from git.index.fun import ( | |
| 12 | 15 | aggressive_tree_merge, | |
@@ -34,6 +37,14 @@ def _assert_index_entries(self, entries, trees): | |||
| 34 | 37 | assert (entry.path, entry.stage) in index.entries | |
| 35 | 38 | # END assert entry matches fully | |
| 36 | 39 | ||
| 40 | + @pytest.mark.xfail( | ||
| 41 | + os.name == "nt", | ||
| 42 | + reason=( | ||
| 43 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 44 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 45 | + ), | ||
| 46 | + raises=GitCommandError, | ||
| 47 | + ) | ||
| 37 | 48 | def test_aggressive_tree_merge(self): | |
| 38 | 49 | # Head tree with additions, removals and modification compared to its predecessor. | |
| 39 | 50 | odb = self.rorepo.odb | |
@@ -291,12 +302,12 @@ def test_linked_worktree_traversal(self, rw_dir): | |||
| 291 | 302 | rw_master.git.worktree("add", worktree_path, branch.name) | |
| 292 | 303 | ||
| 293 | 304 | dotgit = osp.join(worktree_path, ".git") | |
| 294 | - statbuf = stat(dotgit) | ||
| 305 | + statbuf = os.stat(dotgit) | ||
| 295 | 306 | self.assertTrue(statbuf.st_mode & S_IFREG) | |
| 296 | 307 | ||
| 297 | 308 | gitdir = find_worktree_git_dir(dotgit) | |
| 298 | 309 | self.assertIsNotNone(gitdir) | |
| 299 | - statbuf = stat(gitdir) | ||
| 310 | + statbuf = os.stat(gitdir) | ||
| 300 | 311 | self.assertTrue(statbuf.st_mode & S_IFDIR) | |
| 301 | 312 | ||
| 302 | 313 | def test_tree_entries_from_data_with_failing_name_decode_py3(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -179,6 +179,14 @@ def add_bad_blob(): | |||
| 179 | 179 | except Exception as ex: | |
| 180 | 180 | assert "index.lock' could not be obtained" not in str(ex) | |
| 181 | 181 | ||
| 182 | + @pytest.mark.xfail( | ||
| 183 | + os.name == "nt", | ||
| 184 | + reason=( | ||
| 185 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 186 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 187 | + ), | ||
| 188 | + raises=GitCommandError, | ||
| 189 | + ) | ||
| 182 | 190 | @with_rw_repo("0.1.6") | |
| 183 | 191 | def test_index_file_from_tree(self, rw_repo): | |
| 184 | 192 | common_ancestor_sha = "5117c9c8a4d3af19a9958677e45cda9269de1541" | |
@@ -229,6 +237,14 @@ def test_index_file_from_tree(self, rw_repo): | |||
| 229 | 237 | # END for each blob | |
| 230 | 238 | self.assertEqual(num_blobs, len(three_way_index.entries)) | |
| 231 | 239 | ||
| 240 | + @pytest.mark.xfail( | ||
| 241 | + os.name == "nt", | ||
| 242 | + reason=( | ||
| 243 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 244 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 245 | + ), | ||
| 246 | + raises=GitCommandError, | ||
| 247 | + ) | ||
| 232 | 248 | @with_rw_repo("0.1.6") | |
| 233 | 249 | def test_index_merge_tree(self, rw_repo): | |
| 234 | 250 | # A bit out of place, but we need a different repo for this: | |
@@ -291,6 +307,14 @@ def test_index_merge_tree(self, rw_repo): | |||
| 291 | 307 | self.assertEqual(len(unmerged_blobs), 1) | |
| 292 | 308 | self.assertEqual(list(unmerged_blobs.keys())[0], manifest_key[0]) | |
| 293 | 309 | ||
| 310 | + @pytest.mark.xfail( | ||
| 311 | + os.name == "nt", | ||
| 312 | + reason=( | ||
| 313 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 314 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 315 | + ), | ||
| 316 | + raises=GitCommandError, | ||
| 317 | + ) | ||
| 294 | 318 | @with_rw_repo("0.1.6") | |
| 295 | 319 | def test_index_file_diffing(self, rw_repo): | |
| 296 | 320 | # Default Index instance points to our index. | |
@@ -425,6 +449,14 @@ def _count_existing(self, repo, files): | |||
| 425 | 449 | ||
| 426 | 450 | # END num existing helper | |
| 427 | 451 | ||
| 452 | + @pytest.mark.xfail( | ||
| 453 | + os.name == "nt", | ||
| 454 | + reason=( | ||
| 455 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 456 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 457 | + ), | ||
| 458 | + raises=GitCommandError, | ||
| 459 | + ) | ||
| 428 | 460 | @with_rw_repo("0.1.6") | |
| 429 | 461 | def test_index_mutation(self, rw_repo): | |
| 430 | 462 | index = rw_repo.index | |
@@ -778,6 +810,14 @@ def make_paths(): | |||
| 778 | 810 | for absfile in absfiles: | |
| 779 | 811 | assert osp.isfile(absfile) | |
| 780 | 812 | ||
| 813 | + @pytest.mark.xfail( | ||
| 814 | + os.name == "nt", | ||
| 815 | + reason=( | ||
| 816 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 817 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 818 | + ), | ||
| 819 | + raises=GitCommandError, | ||
| 820 | + ) | ||
| 781 | 821 | @with_rw_repo("HEAD") | |
| 782 | 822 | def test_compare_write_tree(self, rw_repo): | |
| 783 | 823 | """Test writing all trees, comparing them for equality.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,8 +4,11 @@ | |||
| 4 | 4 | # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ | |
| 5 | 5 | ||
| 6 | 6 | from itertools import chain | |
| 7 | + import os | ||
| 7 | 8 | from pathlib import Path | |
| 8 | 9 | ||
| 10 | + import pytest | ||
| 11 | + | ||
| 9 | 12 | from git import ( | |
| 10 | 13 | Reference, | |
| 11 | 14 | Head, | |
@@ -215,6 +218,14 @@ def test_head_checkout_detached_head(self, rw_repo): | |||
| 215 | 218 | assert isinstance(res, SymbolicReference) | |
| 216 | 219 | assert res.name == "HEAD" | |
| 217 | 220 | ||
| 221 | + @pytest.mark.xfail( | ||
| 222 | + os.name == "nt", | ||
| 223 | + reason=( | ||
| 224 | + "IndexFile.from_tree is broken on Windows (related to NamedTemporaryFile), see #1630.\n" | ||
| 225 | + "'git read-tree --index-output=...' fails with 'fatal: unable to write new index file'." | ||
| 226 | + ), | ||
| 227 | + raises=GitCommandError, | ||
| 228 | + ) | ||
| 218 | 229 | @with_rw_repo("0.1.6") | |
| 219 | 230 | def test_head_reset(self, rw_repo): | |
| 220 | 231 | cur_head = rw_repo.head | |
| Back | FazBrowse Home | New Git URL |
0 commit comments