Skip to content

Commit 9ea67e4

Browse files
committed
Add isremote method to refs
Adds an easy interface to determine if a reference is a remote reference or a local reference
1 parent 0b820e6 commit 9ea67e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git/refs/symbolic.py

+4
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ def log_entry(self, index):
368368
In that case, it will be faster than the ``log()`` method"""
369369
return RefLog.entry_at(RefLog.path(self), index)
370370

371+
def isremote(self):
372+
""":return: (boolean) Is the reference to a remote branch"""
373+
return self.path.startswith(self._remote_common_path_default + "/")
374+
371375
@classmethod
372376
def to_full_path(cls, path):
373377
"""

0 commit comments

Comments
 (0)