summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/blame.h12
-rw-r--r--include/git2/commit.h13
-rw-r--r--include/git2/diff.h5
-rw-r--r--include/git2/submodule.h13
4 files changed, 35 insertions, 8 deletions
diff --git a/include/git2/blame.h b/include/git2/blame.h
index 173e9994b..84bb7f94c 100644
--- a/include/git2/blame.h
+++ b/include/git2/blame.h
@@ -74,8 +74,8 @@ typedef struct git_blame_options {
uint16_t min_match_characters;
git_oid newest_commit;
git_oid oldest_commit;
- uint32_t min_line;
- uint32_t max_line;
+ size_t min_line;
+ size_t max_line;
} git_blame_options;
#define GIT_BLAME_OPTIONS_VERSION 1
@@ -113,15 +113,15 @@ GIT_EXTERN(int) git_blame_init_options(
* root, or the commit specified in git_blame_options.oldest_commit)
*/
typedef struct git_blame_hunk {
- uint16_t lines_in_hunk;
+ size_t lines_in_hunk;
git_oid final_commit_id;
- uint16_t final_start_line_number;
+ size_t final_start_line_number;
git_signature *final_signature;
git_oid orig_commit_id;
const char *orig_path;
- uint16_t orig_start_line_number;
+ size_t orig_start_line_number;
git_signature *orig_signature;
char boundary;
@@ -156,7 +156,7 @@ GIT_EXTERN(const git_blame_hunk*) git_blame_get_hunk_byindex(
*/
GIT_EXTERN(const git_blame_hunk*) git_blame_get_hunk_byline(
git_blame *blame,
- uint32_t lineno);
+ size_t lineno);
/**
* Get the blame for a single file.
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 04711c1fa..34d29ed81 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -128,6 +128,19 @@ GIT_EXTERN(const char *) git_commit_message_raw(const git_commit *commit);
GIT_EXTERN(const char *) git_commit_summary(git_commit *commit);
/**
+ * Get the long "body" of the git commit message.
+ *
+ * The returned message is the body of the commit, comprising
+ * everything but the first paragraph of the message. Leading and
+ * trailing whitespaces are trimmed.
+ *
+ * @param commit a previously loaded commit.
+ * @return the body of a commit or NULL when no the message only
+ * consists of a summary
+ */
+GIT_EXTERN(const char *) git_commit_body(git_commit *commit);
+
+/**
* Get the commit time (i.e. committer time) of a commit.
*
* @param commit a previously loaded commit.
diff --git a/include/git2/diff.h b/include/git2/diff.h
index cbffdb49a..3eb265652 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -1286,12 +1286,15 @@ typedef struct {
/** Summary of the change */
const char *summary;
+ /** Commit message's body */
+ const char *body;
+
/** Author of the change */
const git_signature *author;
} git_diff_format_email_options;
#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
-#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL}
+#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
/**
* Create an e-mail ready patch from a diff.
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index 689fe4b64..bc94eacaa 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -108,6 +108,17 @@ typedef enum {
GIT_SUBMODULE_STATUS_WD_UNTRACKED)) != 0)
/**
+ * Function pointer to receive each submodule
+ *
+ * @param sm git_submodule currently being visited
+ * @param name name of the submodule
+ * @param payload value you passed to the foreach function as payload
+ * @return 0 on success or error code
+ */
+typedef int (*git_submodule_cb)(
+ git_submodule *sm, const char *name, void *payload);
+
+/**
* Submodule update options structure
*
* Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings,
@@ -239,7 +250,7 @@ GIT_EXTERN(void) git_submodule_free(git_submodule *submodule);
*/
GIT_EXTERN(int) git_submodule_foreach(
git_repository *repo,
- int (*callback)(git_submodule *sm, const char *name, void *payload),
+ git_submodule_cb callback,
void *payload);
/**