diff options
context:
space:
mode:
Diffstat (limited to 'source/ui-tree.c')
-rw-r--r--source/ui-tree.c14
1 file changed, 8 insertions, 6 deletions
diff --git a/source/ui-tree.c b/source/ui-tree.c
index 870ace2..b5a5556 100644
--- a/source/ui-tree.c
+++ b/source/ui-tree.c
@@ -161,19 +161,21 @@ struct single_tree_ctx {
static int single_tree_cb(const struct object_id *oid, struct strbuf *base,
const char *pathname, unsigned mode, void *cbdata)
{
- struct single_tree_ctx *ctx = cbdata;
+ // Not named ctx: that is the global request context, and shadowing it
+ // here would hide it from anything added to this function later.
+ struct single_tree_ctx *tree_ctx = cbdata;
- if (++ctx->count > 1)
+ if (++tree_ctx->count > 1)
return -1;
if (!S_ISDIR(mode)) {
- ctx->count = 2;
+ tree_ctx->count = 2;
return -1;
}
- ctx->name = xstrdup(pathname);
- oidcpy(&ctx->oid, oid);
- strbuf_addf(ctx->path, "/%s", pathname);
+ tree_ctx->name = xstrdup(pathname);
+ oidcpy(&tree_ctx->oid, oid);
+ strbuf_addf(tree_ctx->path, "/%s", pathname);
return 0;
}