Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
checkout: constify parameters of checkout_stage() and checkout_merged()
author
René Scharfe
<l.s.r@web.de>
Tue, 13 Sep 2016 17:11:52 +0000
(19:11 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 13 Sep 2016 23:12:28 +0000
(16:12 -0700)
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>
builtin/checkout.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0b65a8d
)
diff --git
a/builtin/checkout.c
b/builtin/checkout.c
index efcbd8f6b5e0b7d551c88c02b6d7d3069a47944d..161f1636a65805c255a9cb25e6a2be4e633c07ca 100644
(file)
--- 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;
}
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)) {
{
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);
}
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;
{
struct cache_entry *ce = active_cache[pos];
const char *path = ce->name;