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
c8a4e8a5
Commit
c8a4e8a5
authored
Apr 29, 2013
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't use uninitialized struct stat in win32
parent
51a91ce8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/odb.c
+12
-4
No files found.
src/odb.c
View file @
c8a4e8a5
...
...
@@ -445,31 +445,39 @@ static int add_default_backends(
{
size_t
i
;
struct
stat
st
;
ino_t
inode
;
git_odb_backend
*
loose
,
*
packed
;
/* TODO: inodes are not really relevant on Win32, so we need to find
* a cross-platform workaround for this */
#ifndef GIT_WIN32
#ifdef GIT_WIN32
GIT_UNUSED
(
i
);
GIT_UNUSED
(
st
);
inode
=
0
;
#else
if
(
p_stat
(
objects_dir
,
&
st
)
<
0
)
{
giterr_set
(
GITERR_ODB
,
"Failed to load object database in '%s'"
,
objects_dir
);
return
-
1
;
}
inode
=
st
.
st_ino
;
for
(
i
=
0
;
i
<
db
->
backends
.
length
;
++
i
)
{
backend_internal
*
backend
=
git_vector_get
(
&
db
->
backends
,
i
);
if
(
backend
->
disk_inode
==
st
.
st_ino
)
if
(
backend
->
disk_inode
==
inode
)
return
0
;
}
#endif
/* add the loose object backend */
if
(
git_odb_backend_loose
(
&
loose
,
objects_dir
,
-
1
,
0
)
<
0
||
add_backend_internal
(
db
,
loose
,
GIT_LOOSE_PRIORITY
,
as_alternates
,
st
.
st_ino
)
<
0
)
add_backend_internal
(
db
,
loose
,
GIT_LOOSE_PRIORITY
,
as_alternates
,
inode
)
<
0
)
return
-
1
;
/* add the packed file backend */
if
(
git_odb_backend_pack
(
&
packed
,
objects_dir
)
<
0
||
add_backend_internal
(
db
,
packed
,
GIT_PACKED_PRIORITY
,
as_alternates
,
st
.
st_ino
)
<
0
)
add_backend_internal
(
db
,
packed
,
GIT_PACKED_PRIORITY
,
as_alternates
,
inode
)
<
0
)
return
-
1
;
return
load_alternates
(
db
,
objects_dir
,
alternate_depth
);
...
...
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