GitPython 3.1.53__py3-none-any.whl → 3.1.55__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- git/__init__.py +1 -1
- git/cmd.py +7 -0
- git/diff.py +12 -2
- git/index/base.py +16 -2
- git/objects/submodule/base.py +1 -1
- git/remote.py +1 -1
- git/repo/base.py +5 -0
- {gitpython-3.1.53.dist-info → gitpython-3.1.55.dist-info}/METADATA +1 -1
- {gitpython-3.1.53.dist-info → gitpython-3.1.55.dist-info}/RECORD +13 -13
- {gitpython-3.1.53.dist-info → gitpython-3.1.55.dist-info}/WHEEL +0 -0
- {gitpython-3.1.53.dist-info → gitpython-3.1.55.dist-info}/licenses/AUTHORS +0 -0
- {gitpython-3.1.53.dist-info → gitpython-3.1.55.dist-info}/licenses/LICENSE +0 -0
- {gitpython-3.1.53.dist-info → gitpython-3.1.55.dist-info}/top_level.txt +0 -0
git/__init__.py
CHANGED
git/cmd.py
CHANGED
|
@@ -1039,11 +1039,18 @@ class Git(metaclass=_GitMeta):
|
|
|
1039
1039
|
option for option in cls._unpack_args([arg for arg in args if arg is not None]) if option.startswith("-")
|
|
1040
1040
|
]
|
|
1041
1041
|
if kwargs:
|
|
1042
|
+
split_single_char_options = kwargs.get("split_single_char_options", True)
|
|
1042
1043
|
for key, value in kwargs.items():
|
|
1043
1044
|
values = value if isinstance(value, (list, tuple)) else (value,)
|
|
1044
1045
|
if any(value is True or (value is not False and value is not None) for value in values):
|
|
1045
1046
|
key = str(key)
|
|
1046
1047
|
options.append(f"-{key}" if len(key) == 1 else f"--{dashify(key)}")
|
|
1048
|
+
if len(key) == 1 and split_single_char_options:
|
|
1049
|
+
options.extend(
|
|
1050
|
+
str(value)
|
|
1051
|
+
for value in values
|
|
1052
|
+
if value is not True and value not in (False, None) and str(value).startswith("-")
|
|
1053
|
+
)
|
|
1047
1054
|
return options
|
|
1048
1055
|
|
|
1049
1056
|
AutoInterrupt: TypeAlias = _AutoInterrupt
|
git/diff.py
CHANGED
|
@@ -9,7 +9,7 @@ import enum
|
|
|
9
9
|
import re
|
|
10
10
|
import warnings
|
|
11
11
|
|
|
12
|
-
from git.cmd import handle_process_output
|
|
12
|
+
from git.cmd import Git, handle_process_output
|
|
13
13
|
from git.compat import defenc
|
|
14
14
|
from git.objects.blob import Blob
|
|
15
15
|
from git.objects.util import mode_str_to_int
|
|
@@ -35,7 +35,6 @@ from git.types import PathLike, Literal
|
|
|
35
35
|
if TYPE_CHECKING:
|
|
36
36
|
from subprocess import Popen
|
|
37
37
|
|
|
38
|
-
from git.cmd import Git
|
|
39
38
|
from git.objects.base import IndexObject
|
|
40
39
|
from git.objects.commit import Commit
|
|
41
40
|
from git.objects.tree import Tree
|
|
@@ -190,6 +189,7 @@ class Diffable:
|
|
|
190
189
|
other: Union[DiffConstants, "Tree", "Commit", str, None] = INDEX,
|
|
191
190
|
paths: Union[PathLike, List[PathLike], Tuple[PathLike, ...], None] = None,
|
|
192
191
|
create_patch: bool = False,
|
|
192
|
+
allow_unsafe_options: bool = False,
|
|
193
193
|
**kwargs: Any,
|
|
194
194
|
) -> "DiffIndex[Diff]":
|
|
195
195
|
"""Create diffs between two items being trees, trees and index or an index and
|
|
@@ -219,6 +219,10 @@ class Diffable:
|
|
|
219
219
|
applied makes the self to other. Patches are somewhat costly as blobs have
|
|
220
220
|
to be read and diffed.
|
|
221
221
|
|
|
222
|
+
:param allow_unsafe_options:
|
|
223
|
+
If ``True``, allow options such as ``--output`` that can write to arbitrary
|
|
224
|
+
filesystem paths.
|
|
225
|
+
|
|
222
226
|
:param kwargs:
|
|
223
227
|
Additional arguments passed to :manpage:`git-diff(1)`, such as ``R=True`` to
|
|
224
228
|
swap both sides of the diff.
|
|
@@ -231,6 +235,12 @@ class Diffable:
|
|
|
231
235
|
an instance of :class:`~git.objects.tree.Tree` or
|
|
232
236
|
:class:`~git.objects.commit.Commit`, or a git command error will occur.
|
|
233
237
|
"""
|
|
238
|
+
if not allow_unsafe_options:
|
|
239
|
+
Git.check_unsafe_options(
|
|
240
|
+
options=Git._option_candidates([other], kwargs),
|
|
241
|
+
unsafe_options=self.repo.unsafe_git_revision_options,
|
|
242
|
+
)
|
|
243
|
+
|
|
234
244
|
args: List[Union[PathLike, Diffable]] = []
|
|
235
245
|
args.append("--abbrev=40") # We need full shas.
|
|
236
246
|
args.append("--full-index") # Get full index paths, not only filenames.
|
git/index/base.py
CHANGED
|
@@ -23,6 +23,7 @@ from gitdb.base import IStream
|
|
|
23
23
|
from gitdb.db import MemoryDB
|
|
24
24
|
|
|
25
25
|
from git.compat import defenc, force_bytes
|
|
26
|
+
from git.cmd import Git
|
|
26
27
|
import git.diff as git_diff
|
|
27
28
|
from git.exc import CheckoutError, GitCommandError, GitError, InvalidGitRepositoryError
|
|
28
29
|
from git.objects import Blob, Commit, Object, Submodule, Tree
|
|
@@ -1492,6 +1493,7 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
|
|
|
1492
1493
|
] = git_diff.INDEX,
|
|
1493
1494
|
paths: Union[PathLike, List[PathLike], Tuple[PathLike, ...], None] = None,
|
|
1494
1495
|
create_patch: bool = False,
|
|
1496
|
+
allow_unsafe_options: bool = False,
|
|
1495
1497
|
**kwargs: Any,
|
|
1496
1498
|
) -> git_diff.DiffIndex[git_diff.Diff]:
|
|
1497
1499
|
"""Diff this index against the working copy or a :class:`~git.objects.tree.Tree`
|
|
@@ -1504,6 +1506,12 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
|
|
|
1504
1506
|
Will only work with indices that represent the default git index as they
|
|
1505
1507
|
have not been initialized with a stream.
|
|
1506
1508
|
"""
|
|
1509
|
+
if not allow_unsafe_options:
|
|
1510
|
+
Git.check_unsafe_options(
|
|
1511
|
+
options=Git._option_candidates([other], kwargs),
|
|
1512
|
+
unsafe_options=self.repo.unsafe_git_revision_options,
|
|
1513
|
+
)
|
|
1514
|
+
|
|
1507
1515
|
# Only run if we are the default repository index.
|
|
1508
1516
|
if self._file_path != self._index_path():
|
|
1509
1517
|
raise AssertionError("Cannot call %r on indices that do not represent the default git index" % self.diff())
|
|
@@ -1560,7 +1568,13 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
|
|
|
1560
1568
|
# Invert the existing R flag.
|
|
1561
1569
|
cur_val = kwargs.get("R", False)
|
|
1562
1570
|
kwargs["R"] = not cur_val
|
|
1563
|
-
return other.diff(
|
|
1571
|
+
return other.diff(
|
|
1572
|
+
self.INDEX,
|
|
1573
|
+
paths,
|
|
1574
|
+
create_patch,
|
|
1575
|
+
allow_unsafe_options=allow_unsafe_options,
|
|
1576
|
+
**kwargs,
|
|
1577
|
+
)
|
|
1564
1578
|
# END diff against other item handling
|
|
1565
1579
|
|
|
1566
1580
|
# If other is not None here, something is wrong.
|
|
@@ -1568,4 +1582,4 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
|
|
|
1568
1582
|
raise ValueError("other must be None, Diffable.INDEX, a Tree or Commit, was %r" % other)
|
|
1569
1583
|
|
|
1570
1584
|
# Diff against working copy - can be handled by superclass natively.
|
|
1571
|
-
return super().diff(other, paths, create_patch, **kwargs)
|
|
1585
|
+
return super().diff(other, paths, create_patch, allow_unsafe_options=allow_unsafe_options, **kwargs)
|
git/objects/submodule/base.py
CHANGED
|
@@ -608,7 +608,7 @@ class Submodule(IndexObject, TraversableIterableObj):
|
|
|
608
608
|
# END verify url
|
|
609
609
|
|
|
610
610
|
## See #525 for ensuring git URLs in config-files are valid under Windows.
|
|
611
|
-
url = Git.polish_url(url)
|
|
611
|
+
url = Git.polish_url(url, expand_vars=False)
|
|
612
612
|
|
|
613
613
|
# It's important to add the URL to the parent config, to let `git submodule` know.
|
|
614
614
|
# Otherwise there is a '-' character in front of the submodule listing:
|
git/remote.py
CHANGED
|
@@ -808,7 +808,7 @@ class Remote(LazyMixin, IterableObj):
|
|
|
808
808
|
"""
|
|
809
809
|
scmd = "add"
|
|
810
810
|
kwargs["insert_kwargs_after"] = scmd
|
|
811
|
-
url = Git.polish_url(url)
|
|
811
|
+
url = Git.polish_url(url, expand_vars=False)
|
|
812
812
|
if not allow_unsafe_protocols:
|
|
813
813
|
Git.check_unsafe_protocols(url)
|
|
814
814
|
repo.git.remote(scmd, "--", name, url, **kwargs)
|
git/repo/base.py
CHANGED
|
@@ -149,6 +149,8 @@ class Repo:
|
|
|
149
149
|
# Can override configuration variables that execute arbitrary commands:
|
|
150
150
|
"--config",
|
|
151
151
|
"-c",
|
|
152
|
+
# Can install hooks that execute during clone:
|
|
153
|
+
"--template",
|
|
152
154
|
]
|
|
153
155
|
"""Options to :manpage:`git-clone(1)` that allow arbitrary commands to be executed.
|
|
154
156
|
|
|
@@ -159,6 +161,9 @@ class Repo:
|
|
|
159
161
|
The ``--config``/``-c`` option allows users to override configuration variables like
|
|
160
162
|
``protocol.allow`` and ``core.gitProxy`` to execute arbitrary commands:
|
|
161
163
|
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---configltkeygtltvaluegt
|
|
164
|
+
|
|
165
|
+
The ``--template`` option can install hooks that execute during clone:
|
|
166
|
+
https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---templatetemplate-directory
|
|
162
167
|
"""
|
|
163
168
|
|
|
164
169
|
unsafe_git_archive_options = [
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
git/__init__.py,sha256=
|
|
2
|
-
git/cmd.py,sha256=
|
|
1
|
+
git/__init__.py,sha256=MLatGhSVEVyaCBp2_aouEftjPWwO8wy_lTyjA0by1_Y,8899
|
|
2
|
+
git/cmd.py,sha256=SfzSWj4dxcXDHdpHQwIfyG3ISknzU8lnoYSi6fFBLbo,75648
|
|
3
3
|
git/compat.py,sha256=y1E6y6O2q5r8clSlr8ZNmuIWG9nmHuehQEsVsmBffs8,4526
|
|
4
4
|
git/config.py,sha256=aLDSuDiiB67W-OLktJpYVjSLwgIqWJtPYbRllNhQ7Gw,38406
|
|
5
5
|
git/db.py,sha256=vIW9uWSbqu99zbuU2ZDmOhVOv1UPTmxrnqiCtRHCfjE,2368
|
|
6
|
-
git/diff.py,sha256=
|
|
6
|
+
git/diff.py,sha256=oMhc8IyMFfN24A7agcnarbFYjsz1vqskYzjh0s7MULw,28169
|
|
7
7
|
git/exc.py,sha256=Gc7g1pHpn8OmTse30NHmJVsBJ2CYH8LxaR8y8UA3lIM,7119
|
|
8
8
|
git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
git/remote.py,sha256=
|
|
9
|
+
git/remote.py,sha256=d68K7XmkYXZUlIoLBDRpRom_df6mbkhWMrcPAP5s11c,46900
|
|
10
10
|
git/types.py,sha256=d3oDduUGjfoqffcUL_GOD-3qroF8m3r9ai6Xi9_FraM,10279
|
|
11
11
|
git/util.py,sha256=27MIkq6AhpjyAHF9r7UEA1pGYRAkxRMiZNo5IJGdJhU,44712
|
|
12
12
|
git/index/__init__.py,sha256=i-Nqb8Lufp9aFbmxpQBORmmQnjEVVM1Pn58fsQkyGgQ,406
|
|
13
|
-
git/index/base.py,sha256=
|
|
13
|
+
git/index/base.py,sha256=yG2hJuFBa15l1sAXji8IPE-llXEjYZHnzTMs5ELvb20,62734
|
|
14
14
|
git/index/fun.py,sha256=Cfrpq6GmhLXGVDDjYiXTN4f4bb35kvw6-cOGOBuJeGc,17862
|
|
15
15
|
git/index/typ.py,sha256=ZjRWp5J79OwFQor1XXN4C6JmHTDclD9H-tKZtAeqyTI,7019
|
|
16
16
|
git/index/util.py,sha256=f0BfE2JPkdypsB2Q_HJ8KU7MC45RRHywL_GWwxa_5hw,3676
|
|
@@ -23,7 +23,7 @@ git/objects/tag.py,sha256=jAGESnpmTEv-dLakPzheT5ILZFFArcItnXYqfxfDrgc,4441
|
|
|
23
23
|
git/objects/tree.py,sha256=MmExcS59Iamb2cBqUvoHPdzgixabyvv5voHabossrl8,13898
|
|
24
24
|
git/objects/util.py,sha256=Nlza4zLgdPmr_Yasyvvs6c1rKtW_wMxI6wDmQpQ3ufw,23846
|
|
25
25
|
git/objects/submodule/__init__.py,sha256=6xySp767LVz3UylWgUalntS_nGXRuVzXxDuFAv_Wc2c,303
|
|
26
|
-
git/objects/submodule/base.py,sha256=
|
|
26
|
+
git/objects/submodule/base.py,sha256=1w39BpgNnpEmEacCLdCGLH-aeIaAMKU0oWUtgVcyVW0,66347
|
|
27
27
|
git/objects/submodule/root.py,sha256=5eTtYNHasqdPq6q0oDCPr7IaO6uAHL3b4DxMoiO2LhE,20246
|
|
28
28
|
git/objects/submodule/util.py,sha256=sQqAYaiSJdFkZa9NlAuK_wTsMNiS-kkQnQjvIoJtc_o,3509
|
|
29
29
|
git/refs/__init__.py,sha256=DWlJNnsx-4jM_E-VycbP-FZUdn6iWhjnH_uZ_pZXBro,509
|
|
@@ -34,11 +34,11 @@ git/refs/remote.py,sha256=WTlkJtpu895jJxbknDNOwL31tivQY_AHQrvroUoFBX4,2902
|
|
|
34
34
|
git/refs/symbolic.py,sha256=7ScmZHwlqPDKX9bxVC5queSZXUgqEY7_J_Si6gDBSLw,36139
|
|
35
35
|
git/refs/tag.py,sha256=AKrFrMhkNzX8e9x5WmDRtHovbN9zYQghuKoneVW-TJg,5002
|
|
36
36
|
git/repo/__init__.py,sha256=CILSVH36fX_WxVFSjD9o1WF5LgsNedPiJvSngKZqfVU,210
|
|
37
|
-
git/repo/base.py,sha256=
|
|
37
|
+
git/repo/base.py,sha256=DZhyKpL1CkfPoXkFRgia6p9d2x7FNuogEhILlT68Xa4,64030
|
|
38
38
|
git/repo/fun.py,sha256=PDFNkuTSGGoQc0EEEXjxHw2_KaKYvVjBZ9rrkwH5Q6Y,23462
|
|
39
|
-
gitpython-3.1.
|
|
40
|
-
gitpython-3.1.
|
|
41
|
-
gitpython-3.1.
|
|
42
|
-
gitpython-3.1.
|
|
43
|
-
gitpython-3.1.
|
|
44
|
-
gitpython-3.1.
|
|
39
|
+
gitpython-3.1.55.dist-info/licenses/AUTHORS,sha256=Iucx_CH3w7_4084yjM6C5BvKfLA8cVfYHWW2pVmpxSk,2410
|
|
40
|
+
gitpython-3.1.55.dist-info/licenses/LICENSE,sha256=hvyUwyGpr7wRUUcTURuv3tIl8lEA3MD3NQ6CvCMbi-s,1503
|
|
41
|
+
gitpython-3.1.55.dist-info/METADATA,sha256=OGO1P4V3YrDUD2W2T5LYColC5EjmEdeS5EsOC4ci54w,14187
|
|
42
|
+
gitpython-3.1.55.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
43
|
+
gitpython-3.1.55.dist-info/top_level.txt,sha256=0hzDuIp8obv624V3GmbqsagBWkk8ohtGU-Bc1PmTT0o,4
|
|
44
|
+
gitpython-3.1.55.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|