diff options
| author | Henry Kleynhans <hkleynhans@bloomberg.net> | 2017-11-12 10:56:50 +0000 |
|---|---|---|
| committer | Henry Kleynhans <hkleynhans@bloomberg.net> | 2017-11-12 12:01:10 +0000 |
| commit | f063dafb1da60625da76a1ea6975a121969cb630 (patch) | |
| tree | 0b9258a114cee911506ac326f736fc236a00dec3 /include/git2 | |
| parent | 1d7c15adf983853cf8df03dc0af411df3fa5fa07 (diff) | |
| download | libgit2-f063dafb1da60625da76a1ea6975a121969cb630.tar.gz | |
signature: distinguish +0000 and -0000 UTC offsets
Git considers '-0000' a valid offset for signature lines. They need to
be treated as _not_ equal to a '+0000' signature offset. Parsing a
signature line stores the offset in a signed integer which does not
distinguish between `+0` and `-0`.
This patch adds an additional flag `sign` to the `git_time` in the
`signature` object which is populated with the sign of the offset. In
addition to exposing this information to the user, this information is
also used to compare signatures.
/cc @pks-t @ethomson
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/git2/types.h b/include/git2/types.h index dfdaa2920..8d9a94710 100644 --- a/include/git2/types.h +++ b/include/git2/types.h @@ -159,6 +159,7 @@ typedef struct git_packbuilder git_packbuilder; typedef struct git_time { git_time_t time; /**< time in seconds from epoch */ int offset; /**< timezone offset, in minutes */ + char sign; /**< indicator for questionable '-0000' offsets in signature */ } git_time; /** An action signature (e.g. for committers, taggers, etc) */ |
