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
9bda5fb8
Commit
9bda5fb8
authored
Feb 18, 2014
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error propagation in shallow call
parent
e0ebaaa5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
src/repository.c
+5
-4
tests/repo/shallow.c
+6
-0
No files found.
src/repository.c
View file @
9bda5fb8
...
...
@@ -2001,9 +2001,10 @@ int git_repository_is_shallow(git_repository *repo)
error
=
git_path_lstat
(
path
.
ptr
,
&
st
);
git_buf_free
(
&
path
);
if
(
error
==
GIT_ENOTFOUND
)
if
(
error
==
GIT_ENOTFOUND
)
{
giterr_clear
();
return
0
;
if
(
error
<
0
)
return
-
1
;
return
st
.
st_size
==
0
?
0
:
1
;
}
return
error
<
0
?
error
:
st
.
st_size
==
0
?
0
:
1
;
}
tests/repo/shallow.c
View file @
9bda5fb8
...
...
@@ -31,3 +31,9 @@ void test_repo_shallow__shallow_repo(void)
cl_assert_equal_i
(
1
,
git_repository_is_shallow
(
g_repo
));
}
void
test_repo_shallow__clears_errors
(
void
)
{
g_repo
=
cl_git_sandbox_init
(
"testrepo.git"
);
cl_assert_equal_i
(
0
,
git_repository_is_shallow
(
g_repo
));
cl_assert_equal_p
(
NULL
,
giterr_last
());
}
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