Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
b2be351a
Commit
b2be351a
authored
Aug 21, 2012
by
Ben Straub
Committed by
Ben Straub
Aug 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: test core.autocrlf
parent
c3588142
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
tests-clar/checkout/checkout.c
+23
-7
No files found.
tests-clar/checkout/checkout.c
View file @
b2be351a
...
@@ -59,19 +59,35 @@ void test_checkout_checkout__crlf(void)
...
@@ -59,19 +59,35 @@ void test_checkout_checkout__crlf(void)
const
char
*
attributes
=
const
char
*
attributes
=
"branch_file.txt text eol=crlf
\n
"
"branch_file.txt text eol=crlf
\n
"
"new.txt text eol=lf
\n
"
;
"new.txt text eol=lf
\n
"
;
const
char
*
expected_readme_text
=
git_config
*
cfg
;
#ifdef GIT_WIN32
"hey there
\r\n
"
;
cl_git_pass
(
git_repository_config__weakptr
(
&
cfg
,
g_repo
));
#else
cl_git_pass
(
git_config_set_bool
(
cfg
,
"core.autocrlf"
,
false
));
"hey there
\n
"
;
#endif
cl_git_mkfile
(
"./testrepo/.gitattributes"
,
attributes
);
cl_git_mkfile
(
"./testrepo/.gitattributes"
,
attributes
);
cl_git_pass
(
git_checkout_head
(
g_repo
,
NULL
,
NULL
));
cl_git_pass
(
git_checkout_head
(
g_repo
,
NULL
,
NULL
));
test_file_contents
(
"./testrepo/README"
,
expected_readme_text
);
test_file_contents
(
"./testrepo/README"
,
"hey there
\n
"
);
test_file_contents
(
"./testrepo/new.txt"
,
"my new file
\n
"
);
test_file_contents
(
"./testrepo/new.txt"
,
"my new file
\n
"
);
test_file_contents
(
"./testrepo/branch_file.txt"
,
"hi
\r\n
bye!
\r\n
"
);
test_file_contents
(
"./testrepo/branch_file.txt"
,
"hi
\r\n
bye!
\r\n
"
);
}
}
void
test_checkout_checkout__win32_autocrlf
(
void
)
{
#ifdef GIT_WIN32
git_config
*
cfg
;
const
char
*
expected_readme_text
=
"hey there
\r\n
"
;
cl_must_pass
(
p_unlink
(
"./testrepo/.gitattributes"
));
cl_git_pass
(
git_repository_config__weakptr
(
&
cfg
,
g_repo
));
cl_git_pass
(
git_config_set_bool
(
cfg
,
"core.autocrlf"
,
true
));
cl_git_pass
(
git_checkout_head
(
g_repo
,
NULL
,
NULL
));
test_file_contents
(
"./testrepo/README"
,
expected_readme_text
);
#endif
}
static
void
enable_symlinks
(
bool
enable
)
static
void
enable_symlinks
(
bool
enable
)
{
{
git_config
*
cfg
;
git_config
*
cfg
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment