summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-10-01 10:28:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-01 20:45:12 (GMT)
commit35ff08be099b36d0be855040a296f985d25dfd0a (patch)
tree0a7018d5549951c4ea77f3b816d975f73ec99d82 /builtin/commit.c
parent91f1f1918430f1ee6f9923d949e1543c49f63204 (diff)
downloadgit-35ff08be099b36d0be855040a296f985d25dfd0a.zip
git-35ff08be099b36d0be855040a296f985d25dfd0a.tar.gz
git-35ff08be099b36d0be855040a296f985d25dfd0a.tar.bz2
prepare_index(): declare return value to be (const char *)
Declare the return value to be const to make it clear that we aren't giving callers permission to write over the string that it points at. (The return value is the filename field of a struct lock_file, which can be used by a signal handler at any time and therefore shouldn't be tampered with.) Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index b0fe784..70f5935 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -315,8 +315,8 @@ static void refresh_cache_or_die(int refresh_flags)
die_resolve_conflict("commit");
}
-static char *prepare_index(int argc, const char **argv, const char *prefix,
- const struct commit *current_head, int is_status)
+static const char *prepare_index(int argc, const char **argv, const char *prefix,
+ const struct commit *current_head, int is_status)
{
struct string_list partial;
struct pathspec pathspec;