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
68a26dfa
Commit
68a26dfa
authored
Oct 22, 2011
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
status: reorder retrieve_head_tree error checks
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
parent
c2892d61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
src/status.c
+2
-4
No files found.
src/status.c
View file @
68a26dfa
...
...
@@ -142,16 +142,14 @@ static int retrieve_head_tree(git_tree **tree_out, git_repository *repo)
*
tree_out
=
NULL
;
error
=
git_repository_head
(
&
resolved_head_ref
,
repo
);
if
(
error
!=
GIT_SUCCESS
&&
error
!=
GIT_ENOTFOUND
)
return
git__rethrow
(
error
,
"HEAD can't be resolved"
);
/*
* We assume that a situation where HEAD exists but can not be resolved is valid.
* A new repository fits this description for instance.
*/
if
(
error
==
GIT_ENOTFOUND
)
return
GIT_SUCCESS
;
if
(
error
<
GIT_SUCCESS
)
return
git__rethrow
(
error
,
"HEAD can't be resolved"
);
if
((
error
=
git_commit_lookup
(
&
head_commit
,
repo
,
git_reference_oid
(
resolved_head_ref
)))
<
GIT_SUCCESS
)
return
git__rethrow
(
error
,
"The tip of HEAD can't be retrieved"
);
...
...
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