Re-initializing a repo triggers bug with `includeIf.onbranch` condition

When reinitializing a repository with an includeIf.onbranch condition then we hit a BUG.

C.f. https://lore.kernel.org/git/Zk2ndVx4gMTV8ZUf@tanuki/