MCPcopy Index your code
hub / github.com/saltstack/salt / clean_stale_refs

Method clean_stale_refs

salt/utils/gitfs.py:2047–2067  ·  view source on GitHub ↗

Clean stale local refs so they don't appear as fileserver environments

(self, local_refs=None)

Source from the content-addressed store, hash-verified

2045 return None
2046
2047 def clean_stale_refs(self, local_refs=None): # pylint: disable=arguments-differ
2048 """
2049 Clean stale local refs so they don't appear as fileserver environments
2050 """
2051 try:
2052 if pygit2.GIT_FETCH_PRUNE:
2053 # Don't need to clean anything, pygit2 can do it by itself
2054 return []
2055 except AttributeError:
2056 # However, only in 0.26.2 and newer
2057 pass
2058 if self.credentials is not None:
2059 log.debug(
2060 "The installed version of pygit2 (%s) does not support "
2061 "detecting stale refs for authenticated remotes, saltenvs "
2062 "will not reflect branches/tags removed from remote '%s'",
2063 PYGIT2_VERSION,
2064 self.id,
2065 )
2066 return []
2067 return super().clean_stale_refs()
2068
2069 def init_remote(self):
2070 """

Callers 2

_fetchMethod · 0.95
_fetchMethod · 0.45

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected