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)
| 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. |
no test coverage detected