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
807d57e7
Commit
807d57e7
authored
Nov 11, 2015
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: implement worktree helpers
parent
8acc3b16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
tests/worktree/worktree_helpers.c
+30
-0
tests/worktree/worktree_helpers.h
+11
-0
No files found.
tests/worktree/worktree_helpers.c
0 → 100644
View file @
807d57e7
#include "clar_libgit2.h"
#include "worktree_helpers.h"
void
cleanup_fixture_worktree
(
worktree_fixture
*
fixture
)
{
if
(
!
fixture
)
return
;
if
(
fixture
->
repo
)
{
git_repository_free
(
fixture
->
repo
);
fixture
->
repo
=
NULL
;
}
if
(
fixture
->
worktree
)
{
git_repository_free
(
fixture
->
worktree
);
fixture
->
worktree
=
NULL
;
}
if
(
fixture
->
reponame
)
cl_fixture_cleanup
(
fixture
->
reponame
);
if
(
fixture
->
worktreename
)
cl_fixture_cleanup
(
fixture
->
worktreename
);
}
void
setup_fixture_worktree
(
worktree_fixture
*
fixture
)
{
if
(
fixture
->
reponame
)
fixture
->
repo
=
cl_git_sandbox_init
(
fixture
->
reponame
);
if
(
fixture
->
worktreename
)
fixture
->
worktree
=
cl_git_sandbox_init
(
fixture
->
worktreename
);
}
tests/worktree/worktree_helpers.h
0 → 100644
View file @
807d57e7
typedef
struct
{
const
char
*
reponame
;
const
char
*
worktreename
;
git_repository
*
repo
;
git_repository
*
worktree
;
}
worktree_fixture
;
#define WORKTREE_FIXTURE_INIT(repo, worktree) { (repo), (worktree), NULL, NULL }
void
cleanup_fixture_worktree
(
worktree_fixture
*
fixture
);
void
setup_fixture_worktree
(
worktree_fixture
*
fixture
);
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