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
b524fe1a
Commit
b524fe1a
authored
Dec 14, 2012
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Local Only ignore ENOTFOUNDs when adding corrupted refs
parent
850b1edf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
src/refs.c
+1
-1
src/transports/local.c
+10
-4
No files found.
src/refs.c
View file @
b524fe1a
...
...
@@ -177,7 +177,7 @@ static int loose_parse_oid(git_oid *oid, git_buf *file_content)
corrupted:
giterr_set
(
GITERR_REFERENCE
,
"Corrupted loose reference file"
);
return
-
1
;
return
GIT_ENOTFOUND
;
}
static
git_ref_t
loose_guess_rtype
(
const
git_buf
*
full_path
)
...
...
src/transports/local.c
View file @
b524fe1a
...
...
@@ -42,6 +42,7 @@ static int add_ref(transport_local *t, const char *name)
git_remote_head
*
head
;
git_object
*
obj
=
NULL
,
*
target
=
NULL
;
git_buf
buf
=
GIT_BUF_INIT
;
int
error
;
head
=
git__calloc
(
1
,
sizeof
(
git_remote_head
));
GITERR_CHECK_ALLOC
(
head
);
...
...
@@ -49,12 +50,17 @@ static int add_ref(transport_local *t, const char *name)
head
->
name
=
git__strdup
(
name
);
GITERR_CHECK_ALLOC
(
head
->
name
);
if
(
git_reference_name_to_id
(
&
head
->
oid
,
t
->
repo
,
name
)
<
0
)
{
/* This is actually okay. Empty repos often have a HEAD that points to
* a nonexistant "refs/haeds/master". */
error
=
git_reference_name_to_id
(
&
head
->
oid
,
t
->
repo
,
name
);
if
(
error
<
0
)
{
git__free
(
head
->
name
);
git__free
(
head
);
return
0
;
if
(
error
==
GIT_ENOTFOUND
)
{
/* This is actually okay. Empty repos often have a HEAD that points to
* a nonexistant "refs/haeds/master". */
giterr_clear
();
return
0
;
}
return
error
;
}
if
(
git_vector_insert
(
&
t
->
refs
,
head
)
<
0
)
...
...
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