-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blame uncommitted deletions starting from HEAD
When starting a blame in the stage view on a deleted line, it seems appropriate to find the commit that added the line. To this end, instead of starting the blame view from the working tree state of a file, use the version at HEAD, which still has the deleted line (unless the line was only just staged). Since we want to visit the line before application of the stage view's diff, diff_get_lineno does not work because it computes the one after diff application. Introduce diff_get_old_lineno to get the correct line number. This works for both staged and unstaged deletions. However, when a file has both staged and unstaged hunks, then blaming an unstaged deletion may jump to the wrong line number because only the unstaged diff is considered. Closes jonas#1008
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters