checkout: constify parameters of checkout_stage() and checkout_merged()
Document the fact that checkout_stage() and checkout_merged() don't change the objects passed to them by adding the modifier const. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Sep 13, 2016 at 19:11 UTC
ce25e4c78d38d88233f9b77ca8603c0bce74e8f1
1 file changed
+3
-3
builtin/checkout.c
+3
-3
@@ -154,8 +154,8 @@ static int check_stages(unsigned stages, const struct cache_entry *ce, int pos)
154
return 0;
155
}
156
157
-static int checkout_stage(int stage, struct cache_entry *ce, int pos,
158
- struct checkout *state)
157
+static int checkout_stage(int stage, const struct cache_entry *ce, int pos,
158
+ const struct checkout *state)
159
{
160
while (pos < active_nr &&
161
!strcmp(active_cache[pos]->name, ce->name)) {
@@ -169,7 +169,7 @@ static int checkout_stage(int stage, struct cache_entry *ce, int pos,
169
return error(_("path '%s' does not have their version"), ce->name);
170
}
171
172
-static int checkout_merged(int pos, struct checkout *state)
172
+static int checkout_merged(int pos, const struct checkout *state)
173
{
174
struct cache_entry *ce = active_cache[pos];
175
const char *path = ce->name;