MCPcopy
hub / github.com/jisaacks/GitGutter / get_compare_against

Method get_compare_against

modules/handler.py:226–242  ·  view source on GitHub ↗

Return the compare target for a view. If interactivly specified a compare target for the view's repository, use it first, then try view's settings, which includes project settings and preferences. Finally try GitGutter.sublime-settings or fall back to HEAD if everyth

(self)

Source from the content-addressed store, hash-verified

224 os.path.join(self._git_tree, '.git', 'rebase-merge'))
225
226 def get_compare_against(self):
227 """Return the compare target for a view.
228
229 If interactivly specified a compare target for the view's repository,
230 use it first, then try view's settings, which includes project
231 settings and preferences. Finally try GitGutter.sublime-settings or
232 fall back to HEAD if everything goes wrong to avoid exceptions.
233
234 Returns:
235 string: HEAD/branch/tag/remote/commit
236 The reference to compare the view against.
237 """
238 # Interactively specified compare target overrides settings.
239 if self._git_tree in self._compare_against_mapping:
240 return self._compare_against_mapping[self._git_tree]
241 # Project settings and Preferences override plugin settings if set.
242 return self.settings.get('compare_against', 'HEAD')
243
244 def set_compare_against(self, compare_against, refresh=False):
245 """Apply a new branch/commit/tag string the view is compared to.

Callers 2

update_git_fileMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected