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
0ac349a9
Commit
0ac349a9
authored
Aug 02, 2012
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repository: Indentation
parent
e5f49501
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
29 deletions
+28
-29
src/repository.c
+28
-29
No files found.
src/repository.c
View file @
0ac349a9
...
@@ -1076,51 +1076,50 @@ int git_repository_head_tree(git_tree **tree, git_repository *repo)
...
@@ -1076,51 +1076,50 @@ int git_repository_head_tree(git_tree **tree, git_repository *repo)
int
git_repository_message
(
char
*
buffer
,
size_t
len
,
git_repository
*
repo
)
int
git_repository_message
(
char
*
buffer
,
size_t
len
,
git_repository
*
repo
)
{
{
git_buf
buf
=
GIT_BUF_INIT
,
path
=
GIT_BUF_INIT
;
git_buf
buf
=
GIT_BUF_INIT
,
path
=
GIT_BUF_INIT
;
struct
stat
st
;
struct
stat
st
;
ssize_t
size
;
ssize_t
size
;
int
error
;
int
error
;
if
(
git_buf_joinpath
(
&
path
,
repo
->
path_repository
,
MERGE_MSG_FILE
)
<
0
)
if
(
git_buf_joinpath
(
&
path
,
repo
->
path_repository
,
MERGE_MSG_FILE
)
<
0
)
return
-
1
;
return
-
1
;
error
=
p_stat
(
git_buf_cstr
(
&
path
),
&
st
);
error
=
p_stat
(
git_buf_cstr
(
&
path
),
&
st
);
if
(
error
<
0
)
{
if
(
error
<
0
)
{
if
(
errno
==
ENOENT
)
if
(
errno
==
ENOENT
)
error
=
GIT_ENOTFOUND
;
error
=
GIT_ENOTFOUND
;
git_buf_free
(
&
path
);
git_buf_free
(
&
path
);
return
error
;
return
error
;
}
}
if
(
buffer
==
NULL
)
{
if
(
buffer
==
NULL
)
{
git_buf_free
(
&
path
);
git_buf_free
(
&
path
);
return
st
.
st_size
;
return
st
.
st_size
;
}
}
if
(
git_futils_readbuffer
(
&
buf
,
git_buf_cstr
(
&
path
))
<
0
)
if
(
git_futils_readbuffer
(
&
buf
,
git_buf_cstr
(
&
path
))
<
0
)
goto
on_error
;
goto
on_error
;
memcpy
(
buffer
,
git_buf_cstr
(
&
buf
),
len
);
memcpy
(
buffer
,
git_buf_cstr
(
&
buf
),
len
);
size
=
git_buf_len
(
&
buf
);
size
=
git_buf_len
(
&
buf
);
git_buf_free
(
&
path
);
git_buf_free
(
&
path
);
git_buf_free
(
&
buf
);
git_buf_free
(
&
buf
);
return
size
;
return
size
;
on_error:
on_error:
git_buf_free
(
&
path
);
git_buf_free
(
&
path
);
return
-
1
;
return
-
1
;
}
}
int
git_repository_message_remove
(
git_repository
*
repo
)
int
git_repository_message_remove
(
git_repository
*
repo
)
{
{
git_buf
path
=
GIT_BUF_INIT
;
git_buf
path
=
GIT_BUF_INIT
;
int
error
;
int
error
;
if
(
git_buf_joinpath
(
&
path
,
repo
->
path_repository
,
MERGE_MSG_FILE
)
<
0
)
if
(
git_buf_joinpath
(
&
path
,
repo
->
path_repository
,
MERGE_MSG_FILE
)
<
0
)
return
-
1
;
return
-
1
;
error
=
p_unlink
(
git_buf_cstr
(
&
path
));
error
=
p_unlink
(
git_buf_cstr
(
&
path
));
git_buf_free
(
&
path
);
git_buf_free
(
&
path
);
...
...
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