summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-19 11:38:33 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-19 11:38:33 -0700
commit9ff700ebacffc8fb8cf80daabfb6503cb24dca0b (patch)
tree63213092f97a3522450c6cbea407b80c37f6c3ca /commit.h
parentceeacc501bc64dcdff180a9250bf2fcea3582837 (diff)
parentf4ef51739343f80c7cb0467244925b3725d65730 (diff)
downloadgit-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.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/commit.h b/commit.h
index a401ddfbc4..470c74569f 100644
--- a/commit.h
+++ b/commit.h
@@ -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);