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
de70aea6
Commit
de70aea6
authored
Dec 03, 2012
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GIT_SIGNATURE_VERSION and friends
parent
2da619ab
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
3 additions
and
24 deletions
+3
-24
include/git2/types.h
+0
-4
src/commit.c
+0
-2
src/notes.c
+0
-6
src/reflog.c
+0
-3
src/signature.c
+1
-3
src/stash.c
+0
-2
src/tag.c
+0
-2
tests-clar/commit/parse.c
+2
-2
No files found.
include/git2/types.h
View file @
de70aea6
...
...
@@ -151,15 +151,11 @@ typedef struct git_time {
/** An action signature (e.g. for committers, taggers, etc) */
typedef
struct
git_signature
{
unsigned
int
version
;
char
*
name
;
/** full name of the author */
char
*
email
;
/** email of the author */
git_time
when
;
/** time when the action happened */
}
git_signature
;
#define GIT_SIGNATURE_VERSION 1
#define GIT_SIGNATURE_INIT {GIT_SIGNATURE_VERSION, 0}
/** In-memory representation of a reference. */
typedef
struct
git_reference
git_reference
;
...
...
src/commit.c
View file @
de70aea6
...
...
@@ -93,8 +93,6 @@ int git_commit_create(
git_odb
*
odb
;
assert
(
git_object_owner
((
const
git_object
*
)
tree
)
==
repo
);
GITERR_CHECK_VERSION
(
author
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
GITERR_CHECK_VERSION
(
committer
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
git_oid__writebuf
(
&
commit
,
"tree "
,
git_object_id
((
const
git_object
*
)
tree
));
...
...
src/notes.c
View file @
de70aea6
...
...
@@ -456,9 +456,6 @@ int git_note_create(
git_commit
*
commit
=
NULL
;
git_tree
*
tree
=
NULL
;
GITERR_CHECK_VERSION
(
author
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
GITERR_CHECK_VERSION
(
committer
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
target
=
git_oid_allocfmt
(
oid
);
GITERR_CHECK_ALLOC
(
target
);
...
...
@@ -486,9 +483,6 @@ int git_note_remove(git_repository *repo, const char *notes_ref,
git_commit
*
commit
=
NULL
;
git_tree
*
tree
=
NULL
;
GITERR_CHECK_VERSION
(
author
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
GITERR_CHECK_VERSION
(
committer
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
target
=
git_oid_allocfmt
(
oid
);
GITERR_CHECK_ALLOC
(
target
);
...
...
src/reflog.c
View file @
de70aea6
...
...
@@ -112,7 +112,6 @@ static int reflog_parse(git_reflog *log, const char *buf, size_t buf_size)
entry
->
committer
=
git__malloc
(
sizeof
(
git_signature
));
GITERR_CHECK_ALLOC
(
entry
->
committer
);
entry
->
committer
->
version
=
GIT_SIGNATURE_VERSION
;
if
(
git_oid_fromstrn
(
&
entry
->
oid_old
,
buf
,
GIT_OID_HEXSZ
)
<
0
)
goto
fail
;
...
...
@@ -298,8 +297,6 @@ int git_reflog_append(git_reflog *reflog, const git_oid *new_oid,
assert
(
reflog
&&
new_oid
&&
committer
);
GITERR_CHECK_VERSION
(
committer
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
if
(
reflog_entry_new
(
&
entry
)
<
0
)
return
-
1
;
...
...
src/signature.c
View file @
de70aea6
...
...
@@ -90,7 +90,6 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema
p
=
git__calloc
(
1
,
sizeof
(
git_signature
));
GITERR_CHECK_ALLOC
(
p
);
p
->
version
=
GIT_SIGNATURE_VERSION
;
if
(
process_trimming
(
name
,
&
p
->
name
,
name
+
strlen
(
name
),
1
)
<
0
||
process_trimming
(
email
,
&
p
->
email
,
email
+
strlen
(
email
),
1
)
<
0
)
...
...
@@ -264,9 +263,8 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
const
char
*
buffer
=
*
buffer_out
;
const
char
*
line_end
,
*
name_end
,
*
email_end
,
*
tz_start
,
*
time_start
;
int
error
=
0
;
git_signature
initsig
=
GIT_SIGNATURE_INIT
;
mem
move
(
sig
,
&
initsig
,
sizeof
(
git_signature
));
mem
set
(
sig
,
0
,
sizeof
(
git_signature
));
if
((
line_end
=
memchr
(
buffer
,
ender
,
buffer_end
-
buffer
))
==
NULL
)
return
signature_error
(
"no newline given"
);
...
...
src/stash.c
View file @
de70aea6
...
...
@@ -523,8 +523,6 @@ int git_stash_save(
assert
(
out
&&
repo
&&
stasher
);
GITERR_CHECK_VERSION
(
stasher
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
if
((
error
=
ensure_non_bare_repository
(
repo
))
<
0
)
return
error
;
...
...
src/tag.c
View file @
de70aea6
...
...
@@ -244,8 +244,6 @@ static int git_tag_create__internal(
assert
(
repo
&&
tag_name
&&
target
);
assert
(
!
create_tag_annotation
||
(
tagger
&&
message
));
GITERR_CHECK_VERSION
(
tagger
,
GIT_SIGNATURE_VERSION
,
"git_signature"
);
if
(
git_object_owner
(
target
)
!=
repo
)
{
giterr_set
(
GITERR_INVALID
,
"The given target does not belong to this repository"
);
return
-
1
;
...
...
tests-clar/commit/parse.c
View file @
de70aea6
...
...
@@ -149,7 +149,7 @@ void test_commit_parse__signature(void)
{
const
char
*
str
=
passcase
->
string
;
size_t
len
=
strlen
(
passcase
->
string
);
struct
git_signature
person
=
GIT_SIGNATURE_INIT
;
struct
git_signature
person
=
{
0
}
;
cl_git_pass
(
git_signature__parse
(
&
person
,
&
str
,
str
+
len
,
passcase
->
header
,
'\n'
));
cl_assert
(
strcmp
(
passcase
->
name
,
person
.
name
)
==
0
);
cl_assert
(
strcmp
(
passcase
->
email
,
person
.
email
)
==
0
);
...
...
@@ -162,7 +162,7 @@ void test_commit_parse__signature(void)
{
const
char
*
str
=
failcase
->
string
;
size_t
len
=
strlen
(
failcase
->
string
);
git_signature
person
=
GIT_SIGNATURE_INIT
;
git_signature
person
=
{
0
}
;
cl_git_fail
(
git_signature__parse
(
&
person
,
&
str
,
str
+
len
,
failcase
->
header
,
'\n'
));
git__free
(
person
.
name
);
git__free
(
person
.
email
);
}
...
...
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