Subject: Re: [PATCH v1 04/11] git-gui: put choose_repository::pick in a proc

From: Mark Levedahl <[email-masked]>
Date: Fri, 15 May 2026 09:33:58 -0400

On 5/15/26 7:00 AM, Aina Boot wrote:
> On 5/14/26 2:33 PM, Mark Levedahl wrote:
>>  set picked 0
>> +proc pick_repo {} {
>> +	unset_gitdir_vars
>> +	load_config 1
>> +	apply_config
>> +	choose_repository::pick
>> +	set _gitdir [git rev-parse --absolute-git-dir]
>> +	set _prefix {}
>> +	set picked 1
>> +}
>> +
>>
> Here inside the proc it create vars locally, "global..." is missing.
>
> Aina
Yes, also, I missed copying the check on the return variable ::_gitdir. That proc should be:

proc pick_repo {} {
    global _gitdir picked
    unset_gitdir_vars
    load_config 1
    apply_config
    choose_repository::pick
    if {![file isdirectory $_gitdir]} {
        exit 1
    }
    set _gitdir [git rev-parse --absolute-git-dir]
    set picked 1
}

Mark