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
d4e6cf0c
Commit
d4e6cf0c
authored
Aug 15, 2013
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odb: remove a duplicate object header formatting function
parent
8380b39a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
src/odb_loose.c
+2
-13
No files found.
src/odb_loose.c
View file @
d4e6cf0c
...
...
@@ -809,17 +809,6 @@ static void loose_backend__stream_free(git_odb_stream *_stream)
git__free
(
stream
);
}
static
int
format_object_header
(
char
*
hdr
,
size_t
n
,
size_t
obj_len
,
git_otype
obj_type
)
{
const
char
*
type_str
=
git_object_type2string
(
obj_type
);
int
len
=
snprintf
(
hdr
,
n
,
"%s %"
PRIuZ
,
type_str
,
obj_len
);
assert
(
len
>
0
);
/* otherwise snprintf() is broken */
assert
(((
size_t
)
len
)
<
n
);
/* otherwise the caller is broken! */
return
len
+
1
;
}
static
int
loose_backend__stream
(
git_odb_stream
**
stream_out
,
git_odb_backend
*
_backend
,
size_t
length
,
git_otype
type
)
{
loose_backend
*
backend
;
...
...
@@ -833,7 +822,7 @@ static int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_
backend
=
(
loose_backend
*
)
_backend
;
*
stream_out
=
NULL
;
hdrlen
=
format_object_header
(
hdr
,
sizeof
(
hdr
),
length
,
type
);
hdrlen
=
git_odb__
format_object_header
(
hdr
,
sizeof
(
hdr
),
length
,
type
);
stream
=
git__calloc
(
1
,
sizeof
(
loose_writestream
));
GITERR_CHECK_ALLOC
(
stream
);
...
...
@@ -872,7 +861,7 @@ static int loose_backend__write(git_oid *oid, git_odb_backend *_backend, const v
backend
=
(
loose_backend
*
)
_backend
;
/* prepare the header for the file */
header_len
=
format_object_header
(
header
,
sizeof
(
header
),
len
,
type
);
header_len
=
git_odb__
format_object_header
(
header
,
sizeof
(
header
),
len
,
type
);
if
(
git_buf_joinpath
(
&
final_path
,
backend
->
objects_dir
,
"tmp_object"
)
<
0
||
git_filebuf_open
(
&
fbuf
,
final_path
.
ptr
,
...
...
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