1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 11:46:07 +02:00

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>
This commit is contained in:
Michael Haggerty 2014-10-01 12:28:17 +02:00 committed by Junio C Hamano
parent 91f1f19184
commit 35ff08be09

View File

@ -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;