From: Shashank S Date: Tue, 27 Oct 2026 17:11:52 GMT Subject: Re: [PATCH v3] prune-packed: remove USE_THE_REPOSITORY_VARIABLE Message-ID: In-Reply-To: On Mon, 26 Oct 2026 at 14:08, Patrick Steinhardt wrote: > > + call to parse_options() will give the short help and exit before the > > + dereference occurs. > > This still doesn't quite put the finger on what's important. What you > need to verify is that there is nothing between the `cmd_foobar()` > entrypoint and the call to `parse_options()` that may dereference the > NULL pointer. How abouT this: > > Update the builtins that call this function to pass their local > `repo` parameters. As all of those builtins are declared with > `RUN_SETUP` we know that they won't execute outside a repository > and thus the repository parameter will be set. Unless the command > was invoked with "-h" to print help, but all new uses of the `repo` > variable are after a call to `parse_options()` which knows to exit > early in case it sees "-h". Thank you i have update this into the v4 patch > > > - if (opts & PRUNE_PACKED_VERBOSE) > > - progress = start_delayed_progress(the_repository, > > - _("Removing duplicate objects"), 256); > > + struct prune_data cb_data = { > > + .r = r, > > + .opts = opts > > + }; > > Indentation is wrong here now, even though it was correct in v2. Sorry, I have done the correction in v4 patch . > > > + if (opts & PRUNE_PACKED_VERBOSE) > > + progress = start_delayed_progress(r, > > + _("Removing duplicate objects"), 256); > > > > - for_each_loose_file_in_source(the_repository->objects->source, > > - prune_object, NULL, prune_subdir, &opts); > > + for_each_loose_file_in_source(r->objects->source, > > Likewise, this is using spaces for indentation now. > > > + prune_object, NULL, prune_subdir, &cb_data); > > > > - /* Ensure we show 100% before finishing progress */ > > - display_progress(progress, 256); > > - stop_progress(&progress); > > + /* Ensure we show 100% before finishing progress */ > > + display_progress(progress, 256); > > + stop_progress(&progress); > > Same here. > > Patrick Thanks again for taking the time to explain all the mistakes . Shashank S Mogaveera