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

Method _update_from_commit

modules/handler.py:317–333  ·  view source on GitHub ↗

Update git file from commit, if the commit id changed. The compared_id is compared to the last compare target. If it changed, the temporary git file is updated from the provided commit. Arguments: compared_id (string): Full hash of the commit the view is current

(self, compared_id)

Source from the content-addressed store, hash-verified

315 return self._update_from_commit(refs)
316
317 def _update_from_commit(self, compared_id):
318 """Update git file from commit, if the commit id changed.
319
320 The compared_id is compared to the last compare target. If it changed,
321 the temporary git file is updated from the provided commit.
322
323 Arguments:
324 compared_id (string): Full hash of the commit the view is currently
325 compared against.
326
327 Returns:
328 bool: True if temporary file was updated, False otherwise.
329 """
330 if self._git_compared_commit == compared_id:
331 return Promise.resolve(False)
332 return self.git_read_file(compared_id).then(
333 functools.partial(self._check_git_file, compared_id))
334
335 def _check_git_file(self, compared_id, output):
336 """Check the result of the git cat-file command.

Callers 1

update_git_fileMethod · 0.95

Calls 3

git_read_fileMethod · 0.95
resolveMethod · 0.80
thenMethod · 0.80

Tested by

no test coverage detected