OnCommitSelected loads/fetches the diff for the selected commit and refreshes the display
(commit *Commit)
| 350 | |
| 351 | // OnCommitSelected loads/fetches the diff for the selected commit and refreshes the display |
| 352 | func (diffView *DiffView) OnCommitSelected(commit *Commit) (err error) { |
| 353 | log.Debugf("DiffView loading diff for selected commit %v", commit.commit.Id()) |
| 354 | |
| 355 | diffID := diffID(commit.oid.String()) |
| 356 | |
| 357 | diffView.lock.Lock() |
| 358 | diffView.lastRequestedDiff = diffID |
| 359 | |
| 360 | if diffView.switchToDiffIfExists(diffID) { |
| 361 | diffView.lock.Unlock() |
| 362 | return |
| 363 | } |
| 364 | |
| 365 | diffView.lock.Unlock() |
| 366 | |
| 367 | diffView.addDiffLoadRequest(&commitDiffLoadRequest{ |
| 368 | commit: commit, |
| 369 | }) |
| 370 | |
| 371 | return |
| 372 | } |
| 373 | |
| 374 | func (diffView *DiffView) switchToDiffIfExists(diffID diffID) (exists bool) { |
| 375 | diffLines, exists := diffView.diffs[diffID] |
nothing calls this directly
no test coverage detected