From: Patrick Steinhardt Date: Fri, 22 Mar 2024 02:01:25 GMT Subject: Re: [PATCH] t5601: exercise clones with "includeIf.*.onbranch" Message-ID: In-Reply-To: On Tue, Mar 12, 2024 at 01:38:26PM -0700, Junio C Hamano wrote: > Patrick Steinhardt writes: > > > +test_expect_success 'clone with includeIf' ' > > + test_when_finished "rm -rf repo \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\"" && > > + git clone --bare --no-local src "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && > > + > > + test_when_finished "rm \"$HOME\"/.gitconfig" && > > + cat >"$HOME"/.gitconfig <<-EOF && > > + [includeIf "onbranch:something"] > > + path = /does/not/exist.inc > > + EOF > > + git clone $HTTPD_URL/smart/repo.git repo > > +' > > Hmph, isn't the end-user expectation more like if you clone with > "git clone -b something" then the configuration stored in the named > file to take effect, while "git clone" that would never place you on > that something branch would ignore that missing file? Is this only > the latter half of the pair? It probably is, but I'm not really sure to be honest. That's why I punted on it and just assert that it doesn't die. In any case I would claim that the current behaviour is really quite broken in Git v2.43: ``` $ cat >$HOME/.gitconfig <$HOME/include <$HOME/.gitconfig <$HOME/.gitconfig <