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
c63aa494
Commit
c63aa494
authored
Jul 07, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: Abort when the temp workdir cannot be created
parent
dbede305
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
tests/test_helpers.c
+8
-4
No files found.
tests/test_helpers.c
View file @
c63aa494
...
@@ -217,9 +217,10 @@ int copydir_recurs(const char *source_directory_path, const char *destination_di
...
@@ -217,9 +217,10 @@ int copydir_recurs(const char *source_directory_path, const char *destination_di
int
open_temp_repo
(
git_repository
**
repo
,
const
char
*
path
)
int
open_temp_repo
(
git_repository
**
repo
,
const
char
*
path
)
{
{
int
error
;
if
(
copydir_recurs
(
path
,
TEMP_REPO_FOLDER
)
<
GIT_SUCCESS
)
{
if
((
error
=
copydir_recurs
(
path
,
TEMP_REPO_FOLDER
))
<
GIT_SUCCESS
)
printf
(
"
\n
Failed to create temporary folder. Aborting test suite.
\n
"
);
return
error
;
exit
(
-
1
);
}
return
git_repository_open
(
repo
,
TEMP_REPO_FOLDER
);
return
git_repository_open
(
repo
,
TEMP_REPO_FOLDER
);
}
}
...
@@ -227,7 +228,10 @@ int open_temp_repo(git_repository **repo, const char *path)
...
@@ -227,7 +228,10 @@ int open_temp_repo(git_repository **repo, const char *path)
void
close_temp_repo
(
git_repository
*
repo
)
void
close_temp_repo
(
git_repository
*
repo
)
{
{
git_repository_free
(
repo
);
git_repository_free
(
repo
);
git_futils_rmdir_r
(
TEMP_REPO_FOLDER
,
1
);
if
(
git_futils_rmdir_r
(
TEMP_REPO_FOLDER
,
1
)
<
GIT_SUCCESS
)
{
printf
(
"
\n
Failed to remove temporary folder. Aborting test suite.
\n
"
);
exit
(
-
1
);
}
}
}
static
int
remove_placeholders_recurs
(
void
*
filename
,
char
*
path
)
static
int
remove_placeholders_recurs
(
void
*
filename
,
char
*
path
)
...
...
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