git: ensure 0/1/2 are open in main()