forked from git-for-windows/git
-
Notifications
You must be signed in to change notification settings - Fork 106
status: deserialize with -uno does not print correct hint #157
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
Merged
jeffhostetler
merged 1 commit into
microsoft:vfs-2.22.0
from
jeffhostetler:vfs-222-status-cache-untracked-hint
Jun 26, 2019
Merged
Changes from all commits
Commits
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 hidden or 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 |
|---|---|---|
|
|
@@ -333,4 +333,59 @@ test_expect_success 'renames' ' | |
| test_i18ncmp output.1 output.2 | ||
| ' | ||
|
|
||
| test_expect_success 'hint message when cached with u=complete' ' | ||
| git init hint && | ||
| echo xxx >hint/xxx && | ||
| git -C hint add xxx && | ||
| git -C hint commit -m xxx && | ||
|
|
||
| cat >expect.clean <<EOF && | ||
| On branch master | ||
| nothing to commit, working tree clean | ||
| EOF | ||
|
Member
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. Please use |
||
|
|
||
| cat >expect.use_u <<EOF && | ||
| On branch master | ||
| nothing to commit (use -u to show untracked files) | ||
| EOF | ||
|
|
||
| # Capture long format output from "no", "normal", and "all" | ||
| # (without using status cache) and verify it matches expected | ||
| # output. | ||
|
|
||
| git -C hint status --untracked-files=normal >hint.output_normal && | ||
| test_i18ncmp expect.clean hint.output_normal && | ||
|
|
||
| git -C hint status --untracked-files=all >hint.output_all && | ||
| test_i18ncmp expect.clean hint.output_all && | ||
|
|
||
| git -C hint status --untracked-files=no >hint.output_no && | ||
| test_i18ncmp expect.use_u hint.output_no && | ||
|
|
||
| # Create long format output for "complete" and create status cache. | ||
|
|
||
| git -C hint status --untracked-files=complete --ignored=matching --serialize=../hint.dat >hint.output_complete && | ||
|
Member
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. I think this line needs to be broken (with a |
||
| test_i18ncmp expect.clean hint.output_complete && | ||
|
|
||
| # Capture long format output using the status cache and verify | ||
| # that the output matches the non-cached version. There are 2 | ||
| # ways to specify untracked-files, so do them both. | ||
|
|
||
| git -C hint status --deserialize=../hint.dat -unormal >hint.d1_normal && | ||
| test_i18ncmp expect.clean hint.d1_normal && | ||
| git -C hint -c status.showuntrackedfiles=normal status --deserialize=../hint.dat >hint.d2_normal && | ||
| test_i18ncmp expect.clean hint.d2_normal && | ||
|
|
||
| git -C hint status --deserialize=../hint.dat -uall >hint.d1_all && | ||
| test_i18ncmp expect.clean hint.d1_all && | ||
| git -C hint -c status.showuntrackedfiles=all status --deserialize=../hint.dat >hint.d2_all && | ||
| test_i18ncmp expect.clean hint.d2_all && | ||
|
|
||
| git -C hint status --deserialize=../hint.dat -uno >hint.d1_no && | ||
| test_i18ncmp expect.use_u hint.d1_no && | ||
| git -C hint -c status.showuntrackedfiles=no status --deserialize=../hint.dat >hint.d2_no && | ||
| test_i18ncmp expect.use_u hint.d2_no | ||
|
|
||
| ' | ||
|
|
||
| test_done | ||
This file contains hidden or 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
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.
Wouldn't
test_commit -C hint xxxbe more succinct than those three lines? (Of course, the file is then calledxxx.t, but it would be easy to adapt the test case to that, no?)