mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 13:12:22 +00:00
Alternate test for autocrlf with status
I couldn't get the last failing test to actually fail. This is a different test suggested by @nulltoken which should fail.
This commit is contained in:
parent
52462e1cce
commit
f8e2cc9a0a
@ -276,7 +276,7 @@ static int find_and_add_filter(git_vector *filters, git_repository *repo, const
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Use the core Git logic to see if we should perform CRLF for this file
|
* Use the core Git logic to see if we should perform CRLF for this file
|
||||||
* based on its attributes & the value of `core.auto_crlf`
|
* based on its attributes & the value of `core.autocrlf`
|
||||||
*/
|
*/
|
||||||
ca.crlf_action = crlf_input_action(&ca);
|
ca.crlf_action = crlf_input_action(&ca);
|
||||||
|
|
||||||
|
@ -824,3 +824,24 @@ void test_status_worktree__new_staged_file_must_handle_crlf(void)
|
|||||||
git_index_free(index);
|
git_index_free(index);
|
||||||
git_repository_free(repo);
|
git_repository_free(repo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_status_worktree__line_endings_dont_count_as_changes_with_autocrlf(void)
|
||||||
|
{
|
||||||
|
git_repository *repo = cl_git_sandbox_init("status");
|
||||||
|
git_config *config;
|
||||||
|
unsigned int status;
|
||||||
|
|
||||||
|
cl_git_pass(git_repository_config(&config, repo));
|
||||||
|
cl_git_pass(git_config_set_bool(config, "core.autocrlf", true));
|
||||||
|
git_config_free(config);
|
||||||
|
|
||||||
|
cl_git_rewritefile("status/current_file", "current_file\r\n");
|
||||||
|
|
||||||
|
cl_git_pass(git_status_file(&status, repo, "current_file"));
|
||||||
|
|
||||||
|
#ifdef GIT_WIN32
|
||||||
|
cl_assert_equal_i(GIT_STATUS_CURRENT, status);
|
||||||
|
#else
|
||||||
|
cl_assert_equal_i(GIT_STATUS_WT_MODIFIED, status);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user