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
7e3c13e0
Commit
7e3c13e0
authored
Jun 29, 2018
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: worktree/bare: gather all tests
parent
68e73791
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
32 deletions
+47
-32
tests/worktree/bare.c
+47
-0
tests/worktree/worktree.c
+0
-32
No files found.
tests/worktree/bare.c
0 → 100644
View file @
7e3c13e0
#include "clar_libgit2.h"
#include "worktree_helpers.h"
#include "submodule/submodule_helpers.h"
#define COMMON_REPO "testrepo.git"
#define WORKTREE_REPO "worktree"
static
git_repository
*
g_repo
;
void
test_worktree_bare__initialize
(
void
)
{
g_repo
=
cl_git_sandbox_init
(
COMMON_REPO
);
cl_assert_equal_i
(
1
,
git_repository_is_bare
(
g_repo
));
cl_assert_equal_i
(
0
,
git_repository_is_worktree
(
g_repo
));
}
void
test_worktree_bare__cleanup
(
void
)
{
cl_fixture_cleanup
(
WORKTREE_REPO
);
cl_git_sandbox_cleanup
();
}
void
test_worktree_bare__list
(
void
)
{
git_strarray
wts
;
cl_git_pass
(
git_worktree_list
(
&
wts
,
g_repo
));
cl_assert_equal_i
(
wts
.
count
,
0
);
git_strarray_free
(
&
wts
);
}
void
test_worktree_bare__add
(
void
)
{
git_worktree
*
wt
;
git_repository
*
wtrepo
;
cl_git_pass
(
git_worktree_add
(
&
wt
,
g_repo
,
"name"
,
WORKTREE_REPO
,
NULL
));
cl_git_pass
(
git_repository_open
(
&
wtrepo
,
WORKTREE_REPO
));
cl_assert_equal_i
(
0
,
git_repository_is_bare
(
wtrepo
));
cl_assert_equal_i
(
1
,
git_repository_is_worktree
(
wtrepo
));
git_worktree_free
(
wt
);
git_repository_free
(
wtrepo
);
}
tests/worktree/worktree.c
View file @
7e3c13e0
...
...
@@ -84,18 +84,6 @@ void test_worktree_worktree__list_in_worktree_repo(void)
git_strarray_free
(
&
wts
);
}
void
test_worktree_worktree__list_bare
(
void
)
{
git_repository
*
repo
;
git_strarray
wts
;
repo
=
cl_git_sandbox_init
(
"testrepo.git"
);
cl_git_pass
(
git_worktree_list
(
&
wts
,
repo
));
cl_assert_equal_i
(
wts
.
count
,
0
);
git_repository_free
(
repo
);
}
void
test_worktree_worktree__list_without_worktrees
(
void
)
{
git_repository
*
repo
;
...
...
@@ -228,26 +216,6 @@ void test_worktree_worktree__init(void)
git_repository_free
(
repo
);
}
void
test_worktree_worktree__add_from_bare
(
void
)
{
git_worktree
*
wt
;
git_repository
*
repo
,
*
wtrepo
;
repo
=
cl_git_sandbox_init
(
"short_tag.git"
);
cl_assert_equal_i
(
1
,
git_repository_is_bare
(
repo
));
cl_assert_equal_i
(
0
,
git_repository_is_worktree
(
repo
));
cl_git_pass
(
git_worktree_add
(
&
wt
,
repo
,
"worktree-frombare"
,
"worktree-frombare"
,
NULL
));
cl_git_pass
(
git_repository_open
(
&
wtrepo
,
"worktree-frombare"
));
cl_assert_equal_i
(
0
,
git_repository_is_bare
(
wtrepo
));
cl_assert_equal_i
(
1
,
git_repository_is_worktree
(
wtrepo
));
git_worktree_free
(
wt
);
git_repository_free
(
repo
);
git_repository_free
(
wtrepo
);
}
void
test_worktree_worktree__add_locked
(
void
)
{
git_worktree
*
wt
;
...
...
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