@@ -6,13 +6,13 @@
#include "hex.h"
#include "patch-ids.h"
-static int patch_id_defined(struct commit *commit)
+static int patch_id_defined(const struct commit *commit)
{
/* must be 0 or 1 parents */
return !commit->parents || !commit->parents->next;
}
-int commit_patch_id(struct commit *commit, struct diff_options *options,
+int commit_patch_id(const struct commit *commit, struct diff_options *options,
struct object_id *oid, int diff_header_only)
{
if (!patch_id_defined(commit))
@@ -19,7 +19,7 @@ struct patch_ids {
struct diff_options diffopts;
};
-int commit_patch_id(struct commit *commit, struct diff_options *options,
+int commit_patch_id(const struct commit *commit, struct diff_options *options,
struct object_id *oid, int);
int init_patch_ids(struct repository *, struct patch_ids *);
int free_patch_ids(struct patch_ids *);
These aren't modified by these functions, and I want to use them somewhere where the commit is in fact a const. Signed-off-by: Michael McClimon <michael@mcclimon.org> --- patch-ids.c | 4 ++-- patch-ids.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)