Compatibility function for pygit2.Reference objects. Older versions of pygit2 use .get_object() to return the object to which the reference points, while newer versions use .peel(). In pygit2 0.27.4, .get_object() was removed. This function will try .peel() first and
(self, obj)
| 1814 | failhard(self.role) |
| 1815 | |
| 1816 | def peel(self, obj): |
| 1817 | """ |
| 1818 | Compatibility function for pygit2.Reference objects. Older versions of |
| 1819 | pygit2 use .get_object() to return the object to which the reference |
| 1820 | points, while newer versions use .peel(). In pygit2 0.27.4, |
| 1821 | .get_object() was removed. This function will try .peel() first and |
| 1822 | fall back to .get_object(). |
| 1823 | """ |
| 1824 | try: |
| 1825 | return obj.peel() |
| 1826 | except AttributeError: |
| 1827 | return obj.get_object() |
| 1828 | |
| 1829 | def checkout(self, fetch_on_fail=True): |
| 1830 | """ |
no test coverage detected