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

Commit6fc9e61

Browse files
committed
Added SymbolicReference.is_remote() utility method.
Based on the functionality proposed in#101[ci skip]
1 parent123cb67 commit6fc9e61

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎git/refs/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def require_remote_ref_path(func):
1818
"""A decorator raising a TypeError if we are not a valid remote, based on the path"""
1919

2020
defwrapper(self,*args):
21-
ifnotself.path.startswith(self._remote_common_path_default+"/"):
21+
ifnotself.is_remote():
2222
raiseValueError("ref path does not point to a remote reference: %s"%self.path)
2323
returnfunc(self,*args)
2424
#END wrapper

‎git/refs/symbolic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,3 +630,7 @@ def from_path(cls, repo, path):
630630
# END exception handling
631631
# END for each type to try
632632
raiseValueError("Could not find reference type suitable to handle path %r"%path)
633+
634+
defis_remote(self):
635+
""":return: True if this symbolic reference points to a remote branch"""
636+
returnself.path.startswith(self._remote_common_path_default+"/")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp