From 9ea67e4d03687660056b7283daa0c17f7221dfd1 Mon Sep 17 00:00:00 2001 From: John Julien Date: Fri, 1 Mar 2013 00:31:13 -0600 Subject: [PATCH] Add isremote method to refs Adds an easy interface to determine if a reference is a remote reference or a local reference --- git/refs/symbolic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 8556a65ed..437f313a0 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -368,6 +368,10 @@ def log_entry(self, index): In that case, it will be faster than the ``log()`` method""" return RefLog.entry_at(RefLog.path(self), index) + def isremote(self): + """:return: (boolean) Is the reference to a remote branch""" + return self.path.startswith(self._remote_common_path_default + "/") + @classmethod def to_full_path(cls, path): """