summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-13 17:11:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-13 23:12:28 (GMT)
commitce25e4c78d38d88233f9b77ca8603c0bce74e8f1 (patch)
treeb3b704d36651b4d81725ee6f1201c590dfacf0f1 /builtin/checkout.c
parent0b65a8dbdb38962e700ee16776a3042beb489060 (diff)
downloadgit-ce25e4c78d38d88233f9b77ca8603c0bce74e8f1.zip
git-ce25e4c78d38d88233f9b77ca8603c0bce74e8f1.tar.gz
git-ce25e4c78d38d88233f9b77ca8603c0bce74e8f1.tar.bz2
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>
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index efcbd8f..161f163 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -154,8 +154,8 @@ static int check_stages(unsigned stages, const struct cache_entry *ce, int pos)
return 0;
}
-static int checkout_stage(int stage, struct cache_entry *ce, int pos,
- struct checkout *state)
+static int checkout_stage(int stage, const struct cache_entry *ce, int pos,
+ const struct checkout *state)
{
while (pos < active_nr &&
!strcmp(active_cache[pos]->name, ce->name)) {
@@ -169,7 +169,7 @@ static int checkout_stage(int stage, struct cache_entry *ce, int pos,
return error(_("path '%s' does not have their version"), ce->name);
}
-static int checkout_merged(int pos, struct checkout *state)
+static int checkout_merged(int pos, const struct checkout *state)
{
struct cache_entry *ce = active_cache[pos];
const char *path = ce->name;