Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad00c77

Browse files
committed
Spell self.Index as self.INDEX in IndexFile.diff
Because, as noted in65863a2, it is now (slightly) preferable towrite INDEX. Note that this is solely stylstic: they are equivalentand must remain so, so that existing code that uses GitPython andaccesses it as Index (including in overridden diff methods whensubclassing Diffable) continues to work.This changes it in the exception message as well.
1 parent97d9b65 commitad00c77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎git/index/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ def diff(
15001500
ifself._file_path!=self._index_path():
15011501
raiseAssertionError("Cannot call %r on indices that do not represent the default git index"%self.diff())
15021502
# Index against index is always empty.
1503-
ifotherisself.Index:
1503+
ifotherisself.INDEX:
15041504
returngit_diff.DiffIndex()
15051505

15061506
# Index against anything but None is a reverse diff with the respective item.
@@ -1514,12 +1514,12 @@ def diff(
15141514
# Invert the existing R flag.
15151515
cur_val=kwargs.get("R",False)
15161516
kwargs["R"]=notcur_val
1517-
returnother.diff(self.Index,paths,create_patch,**kwargs)
1517+
returnother.diff(self.INDEX,paths,create_patch,**kwargs)
15181518
# END diff against other item handling
15191519

15201520
# If other is not None here, something is wrong.
15211521
ifotherisnotNone:
1522-
raiseValueError("other must be None, Diffable.Index, a Tree or Commit, was %r"%other)
1522+
raiseValueError("other must be None, Diffable.INDEX, a Tree or Commit, was %r"%other)
15231523

15241524
# Diff against working copy - can be handled by superclass natively.
15251525
returnsuper().diff(other,paths,create_patch,**kwargs)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp