| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f44c1fb commit 09f2cf3
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ Changelog | |||
| 8 | 8 | Security fixes for | |
| 9 | 9 | ||
| 10 | 10 | * https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-g5vv-9gxw-82hx | |
| 11 | + * https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-whh4-5q6c-9v3x | ||
| 11 | 12 | ||
| 12 | 13 | If you can, also try and provide feedback on the upcoming v4 branch | |
| 13 | 14 | https://github.com/gitpython-developers/GitPython/pull/2177 - patches welcome. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -239,8 +239,8 @@ def diff( | |||
| 239 | 239 | to be read and diffed. | |
| 240 | 240 | ||
| 241 | 241 | :param allow_unsafe_options: | |
| 242 | - If ``True``, allow options such as ``--output`` and ``-O`` that can write to | ||
| 243 | - or read from arbitrary filesystem paths. | ||
| 242 | + If ``True``, allow options such as ``--output``, ``--no-index``, and ``-O`` | ||
| 243 | + that can write to or read from arbitrary filesystem paths. | ||
| 244 | 244 | ||
| 245 | 245 | :param kwargs: | |
| 246 | 246 | Additional arguments passed to :manpage:`git-diff(1)`, such as ``R=True`` to | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -209,6 +209,8 @@ class Repo: | |||
| 209 | 209 | ] | |
| 210 | 210 | ||
| 211 | 211 | unsafe_git_diff_options = unsafe_git_revision_options + [ | |
| 212 | + # Treats path operands as arbitrary filesystem paths. | ||
| 213 | + "--no-index", | ||
| 212 | 214 | # Reads caller-controlled order patterns from an arbitrary file. | |
| 213 | 215 | "-O", | |
| 214 | 216 | "--orderfile", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -412,6 +412,17 @@ def test_diff_rejects_unsafe_output_options(self): | |||
| 412 | 412 | commit.diff(output=allowed_target, allow_unsafe_options=True) | |
| 413 | 413 | self.assertTrue(osp.isfile(allowed_target)) | |
| 414 | 414 | ||
| 415 | + def test_diff_rejects_no_index(self): | ||
| 416 | + calls = ( | ||
| 417 | + lambda: self.rorepo.head.commit.diff(no_index=True), | ||
| 418 | + lambda: self.rorepo.head.commit.diff(other="--no-index"), | ||
| 419 | + lambda: self.rorepo.index.diff(None, no_index=True), | ||
| 420 | + lambda: self.rorepo.index.diff("--no-index"), | ||
| 421 | + ) | ||
| 422 | + for call in calls: | ||
| 423 | + with self.assertRaises(UnsafeOptionError): | ||
| 424 | + call() | ||
| 425 | + | ||
| 415 | 426 | def test_diff_interface(self): | |
| 416 | 427 | """Test a few variations of the main diff routine.""" | |
| 417 | 428 | assertion_map = {} | |
| Back | FazBrowse Home | New Git URL |
0 commit comments