diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-19 11:38:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-19 11:38:33 -0700 |
commit | 9ff700ebacffc8fb8cf80daabfb6503cb24dca0b (patch) | |
tree | 63213092f97a3522450c6cbea407b80c37f6c3ca /commit.h | |
parent | ceeacc501bc64dcdff180a9250bf2fcea3582837 (diff) | |
parent | f4ef51739343f80c7cb0467244925b3725d65730 (diff) | |
download | git-9ff700ebacffc8fb8cf80daabfb6503cb24dca0b.tar.gz |
Merge branch 'jk/commit-author-parsing'
Code clean-up.
* jk/commit-author-parsing:
determine_author_info(): copy getenv output
determine_author_info(): reuse parsing functions
date: use strbufs in date-formatting functions
record_author_date(): use find_commit_header()
record_author_date(): fix memory leak on malformed commit
commit: provide a function to find a header in a buffer
Diffstat (limited to 'commit.h')
-rw-r--r-- | commit.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -326,6 +326,17 @@ extern struct commit_extra_header *read_commit_extra_headers(struct commit *, co extern void free_commit_extra_headers(struct commit_extra_header *extra); +/* + * Search the commit object contents given by "msg" for the header "key". + * Returns a pointer to the start of the header contents, or NULL. The length + * of the header, up to the first newline, is returned via out_len. + * + * Note that some headers (like mergetag) may be multi-line. It is the caller's + * responsibility to parse further in this case! + */ +extern const char *find_commit_header(const char *msg, const char *key, + size_t *out_len); + typedef void (*each_mergetag_fn)(struct commit *commit, struct commit_extra_header *extra, void *cb_data); |