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

Commit4536b63

Browse files
committed
Update git-source citation in Reference.set_object
Reference.set_object explains its handling of oldbinsha by quotinga comment from refs.c in the Git source code. However, that commentnow appears in refs/files-backend.c in that codebase. This updatesthe reference so readers can look it up and find the comment in itssurrounding context.The commit to the git project's source code that moved the codethat includes that comment is:git/git@7bd9bcf
1 parent9fea488 commit4536b63

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

‎git/refs/reference.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,19 @@ def set_object(
8686
super(Reference,self).set_object(object,logmsg)
8787

8888
ifoldbinshaisnotNone:
89-
# /* from refs.c in git-source
90-
# * Special hack: If a branch is updated directly and HEAD
91-
# * points to it (may happen on the remote side of a push
92-
# * for example) then logically the HEAD reflog should be
93-
# * updated too.
94-
# * A generic solution implies reverse symref information,
95-
# * but finding all symrefs pointing to the given branch
96-
# * would be rather costly for this rare event (the direct
97-
# * update of a branch) to be worth it. So let's cheat and
98-
# * check with HEAD only which should cover 99% of all usage
99-
# * scenarios (even 100% of the default ones).
100-
# */
89+
# From refs/files-backend.c in git-source:
90+
# /*
91+
# * Special hack: If a branch is updated directly and HEAD
92+
# * points to it (may happen on the remote side of a push
93+
# * for example) then logically the HEAD reflog should be
94+
# * updated too.
95+
# * A generic solution implies reverse symref information,
96+
# * but finding all symrefs pointing to the given branch
97+
# * would be rather costly for this rare event (the direct
98+
# * update of a branch) to be worth it. So let's cheat and
99+
# * check with HEAD only which should cover 99% of all usage
100+
# * scenarios (even 100% of the default ones).
101+
# */
101102
self.repo.head.log_append(oldbinsha,logmsg)
102103
# END check if the head
103104

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp