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
482e3853
Commit
482e3853
authored
Sep 20, 2021
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'mathworks/longpath_filter_bug' into main
parents
0644c2e8
0d30e7bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
src/blob.c
+4
-3
tests/win32/longpath.c
+24
-4
No files found.
src/blob.c
View file @
482e3853
...
...
@@ -138,12 +138,13 @@ static int write_file_filtered(
git_object_size_t
*
size
,
git_odb
*
odb
,
const
char
*
full_path
,
git_filter_list
*
fl
)
git_filter_list
*
fl
,
git_repository
*
repo
)
{
int
error
;
git_buf
tgt
=
GIT_BUF_INIT
;
error
=
git_filter_list_apply_to_file
(
&
tgt
,
fl
,
NULL
,
full_path
);
error
=
git_filter_list_apply_to_file
(
&
tgt
,
fl
,
repo
,
full_path
);
/* Write the file to disk if it was properly filtered */
if
(
!
error
)
{
...
...
@@ -238,7 +239,7 @@ int git_blob__create_from_paths(
error
=
write_file_stream
(
id
,
odb
,
content_path
,
size
);
else
{
/* We need to apply one or more filters */
error
=
write_file_filtered
(
id
,
&
size
,
odb
,
content_path
,
fl
);
error
=
write_file_filtered
(
id
,
&
size
,
odb
,
content_path
,
fl
,
repo
);
git_filter_list_free
(
fl
);
}
...
...
tests/win32/longpath.c
View file @
482e3853
...
...
@@ -64,15 +64,12 @@ void test_win32_longpath__workdir_path_validated(void)
#endif
}
void
test_win32_longpath__status_and_add
(
void
)
{
#ifdef GIT_WIN32
git_repository
*
repo
=
cl_git_sandbox_init
(
"testrepo"
);
static
void
assert_longpath_status_and_add
(
git_repository
*
repo
)
{
git_index
*
index
;
git_buf
out
=
GIT_BUF_INIT
;
unsigned
int
status_flags
;
cl_repo_set_bool
(
repo
,
"core.longpaths"
,
true
);
cl_git_pass
(
git_repository_workdir_path
(
&
out
,
repo
,
LONG_FILENAME
));
cl_git_rewritefile
(
out
.
ptr
,
"This is a long path.
\r\n
"
);
...
...
@@ -88,5 +85,28 @@ void test_win32_longpath__status_and_add(void)
git_index_free
(
index
);
git_buf_dispose
(
&
out
);
}
#endif
void
test_win32_longpath__status_and_add
(
void
)
{
#ifdef GIT_WIN32
git_repository
*
repo
=
cl_git_sandbox_init
(
"testrepo"
);
cl_repo_set_bool
(
repo
,
"core.longpaths"
,
true
);
assert_longpath_status_and_add
(
repo
);
#endif
}
void
test_win32_longpath__status_and_add_with_filter
(
void
)
{
#ifdef GIT_WIN32
git_repository
*
repo
=
cl_git_sandbox_init
(
"testrepo"
);
cl_repo_set_bool
(
repo
,
"core.longpaths"
,
true
);
cl_repo_set_bool
(
repo
,
"core.autocrlf"
,
true
);
assert_longpath_status_and_add
(
repo
);
#endif
}
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