@@ -39,7 +39,7 @@ abstract class AbstractTest extends TestCase
3939 *
4040 * @return Repository
4141 */
42- public static function createEmptyRepository ($ bare = true )
42+ public static function createEmptyRepository ($ bare = true , $ separateGitDir = false )
4343 {
4444 $ dir = self ::createTempDir ();
4545 $ repository = Admin::init ($ dir , $ bare , self ::getOptions ());
@@ -56,6 +56,7 @@ public static function provideFoobar()
5656 return [
5757 [self ::createFoobarRepository ()],
5858 [self ::createFoobarRepository (false )],
59+ [self ::createFoobarRepository (false , true )]
5960 ];
6061 }
6162
@@ -75,10 +76,12 @@ public static function provideEmpty()
7576 *
7677 * @return Repository
7778 */
78- public static function createFoobarRepository ($ bare = true )
79+ public static function createFoobarRepository ($ bare = true , $ separateGitDirectory = false )
7980 {
81+ $ args = $ separateGitDirectory ? ['--separate-git-dir= ' . tempnam (sys_get_temp_dir (), 'gitlib_ ' )] : [];
82+
8083 if (null === self ::$ localRepository ) {
81- self ::$ localRepository = Admin::cloneTo (self ::createTempDir (), self ::REPOSITORY_URL , $ bare , self ::getOptions ());
84+ self ::$ localRepository = Admin::cloneTo (self ::createTempDir (), self ::REPOSITORY_URL , $ bare , self ::getOptions (), $ args );
8285 }
8386
8487 $ repository = self ::$ localRepository ->cloneTo (self ::createTempDir (), $ bare , self ::getOptions ());
0 commit comments