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
72fbf05c
Commit
72fbf05c
authored
Dec 20, 2017
by
Charlie Somerville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trailer: use git__prefixcmp instead of starts_with
parent
13722611
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
src/trailer.c
+3
-15
No files found.
src/trailer.c
View file @
72fbf05c
...
...
@@ -65,18 +65,6 @@ static int last_line(const char *buf, size_t len)
return
0
;
}
static
bool
starts_with
(
const
char
*
str
,
const
char
*
prefix
)
{
size_t
str_len
=
strlen
(
str
);
size_t
prefix_len
=
strlen
(
prefix
);
if
(
prefix_len
>
str_len
)
{
return
false
;
}
return
memcmp
(
str
,
prefix
,
prefix_len
)
==
0
;
}
/*
* If the given line is of the form
* "<token><optional whitespace><separator>..." or "<separator>...", return the
...
...
@@ -136,7 +124,7 @@ static int ignore_non_trailer(const char *buf, size_t len)
if
(
!
boc
)
boc
=
bol
;
/* otherwise, it is just continuing */
}
else
if
(
starts_with
(
buf
+
bol
,
"Conflicts:
\n
"
)
)
{
}
else
if
(
git__prefixcmp
(
buf
+
bol
,
"Conflicts:
\n
"
)
==
0
)
{
in_old_conflicts_block
=
1
;
if
(
!
boc
)
boc
=
bol
;
...
...
@@ -161,7 +149,7 @@ static int find_patch_start(const char *str)
const
char
*
s
;
for
(
s
=
str
;
*
s
;
s
=
next_line
(
s
))
{
if
(
starts_with
(
s
,
"---"
)
)
if
(
git__prefixcmp
(
s
,
"---"
)
==
0
)
return
s
-
str
;
}
...
...
@@ -227,7 +215,7 @@ static int find_trailer_start(const char *buf, size_t len)
only_spaces
=
0
;
for
(
p
=
git_generated_prefixes
;
*
p
;
p
++
)
{
if
(
starts_with
(
bol
,
*
p
)
)
{
if
(
git__prefixcmp
(
bol
,
*
p
)
==
0
)
{
trailer_lines
++
;
possible_continuation_lines
=
0
;
recognized_prefix
=
1
;
...
...
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