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
d095502e
Commit
d095502e
authored
Aug 08, 2021
by
Peter Pettersson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: don't generate false positives on empty path segments
parent
e96fc028
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
15 deletions
+16
-15
tests/iterator/workdir.c
+1
-1
tests/merge/workdir/setup.c
+2
-2
tests/odb/foreach.c
+1
-1
tests/worktree/merge.c
+3
-3
tests/worktree/worktree.c
+9
-8
No files found.
tests/iterator/workdir.c
View file @
d095502e
...
...
@@ -1024,7 +1024,7 @@ static void create_paths(const char *root, int depth)
int
i
;
cl_git_pass
(
git_buf_puts
(
&
fullpath
,
root
));
cl_git_pass
(
git_
buf_putc
(
&
fullpath
,
'/'
));
cl_git_pass
(
git_
path_to_dir
(
&
fullpath
));
root_len
=
fullpath
.
size
;
...
...
tests/merge/workdir/setup.c
View file @
d095502e
...
...
@@ -49,7 +49,7 @@ static bool test_file_contents(const char *filename, const char *expected)
git_buf
file_path_buf
=
GIT_BUF_INIT
,
file_buf
=
GIT_BUF_INIT
;
bool
equals
;
git_buf_
printf
(
&
file_path_buf
,
"%s/%s"
,
git_repository_path
(
repo
),
filename
);
git_buf_
joinpath
(
&
file_path_buf
,
git_repository_path
(
repo
),
filename
);
cl_git_pass
(
git_futils_readbuffer
(
&
file_buf
,
file_path_buf
.
ptr
));
equals
=
(
strcmp
(
file_buf
.
ptr
,
expected
)
==
0
);
...
...
@@ -64,7 +64,7 @@ static void write_file_contents(const char *filename, const char *output)
{
git_buf
file_path_buf
=
GIT_BUF_INIT
;
git_buf_
printf
(
&
file_path_buf
,
"%s/%s"
,
git_repository_path
(
repo
),
git_buf_
joinpath
(
&
file_path_buf
,
git_repository_path
(
repo
),
filename
);
cl_git_rewritefile
(
file_path_buf
.
ptr
,
output
);
...
...
tests/odb/foreach.c
View file @
d095502e
...
...
@@ -127,7 +127,7 @@ void test_odb_foreach__files_in_objects_dir(void)
cl_fixture_sandbox
(
"testrepo.git"
);
cl_git_pass
(
git_repository_open
(
&
repo
,
"testrepo.git"
));
cl_git_pass
(
git_buf_
printf
(
&
buf
,
"%s/objects/somefile"
,
git_repository_path
(
repo
)
));
cl_git_pass
(
git_buf_
joinpath
(
&
buf
,
git_repository_path
(
repo
),
"objects/somefile"
));
cl_git_mkfile
(
buf
.
ptr
,
""
);
git_buf_dispose
(
&
buf
);
...
...
tests/worktree/merge.c
View file @
d095502e
...
...
@@ -70,9 +70,9 @@ void test_worktree_merge__merge_setup(void)
ours
,
(
const
git_annotated_commit
**
)
&
theirs
,
1
));
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
merge_files
);
i
++
)
{
git_buf_clear
(
&
path
);
cl_git_pass
(
git_buf_printf
(
&
path
,
"%s/%s"
,
fixture
.
worktree
->
gitdir
,
merge_files
[
i
]));
cl_git_pass
(
git_buf_joinpath
(
&
path
,
fixture
.
worktree
->
gitdir
,
merge_files
[
i
]));
cl_assert
(
git_path_exists
(
path
.
ptr
));
}
...
...
tests/worktree/worktree.c
View file @
d095502e
...
...
@@ -44,8 +44,9 @@ void test_worktree_worktree__list_with_invalid_worktree_dirs(void)
git_strarray
wts
;
size_t
i
,
j
,
len
;
cl_git_pass
(
git_buf_printf
(
&
path
,
"%s/worktrees/invalid"
,
fixture
.
repo
->
commondir
));
cl_git_pass
(
git_buf_joinpath
(
&
path
,
fixture
.
repo
->
commondir
,
"worktrees/invalid"
));
cl_git_pass
(
p_mkdir
(
path
.
ptr
,
0755
));
len
=
path
.
size
;
...
...
@@ -145,9 +146,9 @@ void test_worktree_worktree__open_invalid_commondir(void)
git_buf
buf
=
GIT_BUF_INIT
,
path
=
GIT_BUF_INIT
;
cl_git_pass
(
git_buf_sets
(
&
buf
,
"/path/to/nonexistent/commondir"
));
cl_git_pass
(
git_buf_
printf
(
&
path
,
"%s/worktrees/testrepo-worktree/commondir"
,
fixture
.
repo
->
commondir
));
cl_git_pass
(
git_buf_
joinpath
(
&
path
,
fixture
.
repo
->
commondir
,
"worktrees/testrepo-worktree/commondir"
));
cl_git_pass
(
git_futils_writebuffer
(
&
buf
,
path
.
ptr
,
O_RDWR
,
0644
));
cl_git_pass
(
git_worktree_lookup
(
&
wt
,
fixture
.
repo
,
"testrepo-worktree"
));
...
...
@@ -165,9 +166,9 @@ void test_worktree_worktree__open_invalid_gitdir(void)
git_buf
buf
=
GIT_BUF_INIT
,
path
=
GIT_BUF_INIT
;
cl_git_pass
(
git_buf_sets
(
&
buf
,
"/path/to/nonexistent/gitdir"
));
cl_git_pass
(
git_buf_
printf
(
&
path
,
"%s/worktrees/testrepo-worktree/gitdir"
,
fixture
.
repo
->
commondir
));
cl_git_pass
(
git_buf_
joinpath
(
&
path
,
fixture
.
repo
->
commondir
,
"worktrees/testrepo-worktree/gitdir"
));
cl_git_pass
(
git_futils_writebuffer
(
&
buf
,
path
.
ptr
,
O_RDWR
,
0644
));
cl_git_pass
(
git_worktree_lookup
(
&
wt
,
fixture
.
repo
,
"testrepo-worktree"
));
...
...
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