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
90388aa8
Commit
90388aa8
authored
Jun 06, 2017
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refdb_fs: be explicit about using null-OID if we cannot resolve ref
parent
78a8f68f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/refdb_fs.c
+3
-2
No files found.
src/refdb_fs.c
View file @
90388aa8
...
...
@@ -1140,7 +1140,7 @@ out:
static
int
maybe_append_head
(
refdb_fs_backend
*
backend
,
const
git_reference
*
ref
,
const
git_signature
*
who
,
const
char
*
message
)
{
int
error
;
git_oid
old_id
=
{{
0
}}
;
git_oid
old_id
;
git_reference
*
tmp
=
NULL
,
*
head
=
NULL
,
*
peeled
=
NULL
;
const
char
*
name
;
...
...
@@ -1148,7 +1148,8 @@ static int maybe_append_head(refdb_fs_backend *backend, const git_reference *ref
return
0
;
/* if we can't resolve, we use {0}*40 as old id */
git_reference_name_to_id
(
&
old_id
,
backend
->
repo
,
ref
->
name
);
if
(
git_reference_name_to_id
(
&
old_id
,
backend
->
repo
,
ref
->
name
)
<
0
)
memset
(
&
old_id
,
0
,
sizeof
(
old_id
));
if
((
error
=
git_reference_lookup
(
&
head
,
backend
->
repo
,
GIT_HEAD_FILE
))
<
0
)
return
error
;
...
...
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