-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Search git status] support previewing merge conflict #262
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
efa72c7
Fix preview for changed paths containing spaces
PatrickF1 81fae01
give argv a name
PatrickF1 7f70521
support merge state
PatrickF1 ad1ecfb
test for unmerged state
PatrickF1 1020c53
remove unnecessary var in tests
PatrickF1 3b245ef
use -- to bulletproof usage of contains
PatrickF1 4c7aab8
write test
PatrickF1 17cc37e
simplify description of preview
PatrickF1 5bc2b67
Merge branch 'main' into support-preview-merge
PatrickF1 a7e8613
contains doesn't need --
PatrickF1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
mock git diff "echo \$argv" | ||
set file dir/file.txt | ||
set output (_fzf_preview_changed_file " D out.log") | ||
|
||
set output (_fzf_preview_changed_file " D $file") | ||
|
||
contains -- "| Unstaged |" $output && not contains "| Staged |" $output | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. contains doesn't need |
||
contains "| Unstaged |" $output && not contains "| Staged |" $output | ||
@test "only shows unstaged changes if file was only deleted in working tree" $status -eq 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mock git diff "echo \$argv" | ||
set output (_fzf_preview_changed_file "UU out.log") | ||
|
||
@test "shows merge conflicts as unmerged" $output[2] = "| Unmerged |" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
mock git diff "echo \$argv" | ||
set file dir/file.txt | ||
set output (_fzf_preview_changed_file "MM $file") | ||
set output (_fzf_preview_changed_file "MM dir/file.txt") | ||
|
||
contains -- "| Unstaged |" $output && contains "| Staged |" $output | ||
contains "| Unstaged |" $output && contains "| Staged |" $output | ||
@test "shows staged and unstaged changes if the file is modified in both places" $status -eq 0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$file was only being used in one place