Skip to content

Commit 5019cc4

Browse files
committed
Avoid using deprecated features in unit tests.
1 parent 3b65d69 commit 5019cc4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/git/repository.d

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ unittest
178178
assert(repoPath.relativePath.toPosixPath == "../.git/modules/test/repo");
179179

180180
// verify the repo can be opened
181-
auto repo = GitRepo(repoPath);
181+
auto repo = openRepository(repoPath);
182182
}
183183

184184
///
@@ -210,7 +210,7 @@ struct GitRepo
210210
///
211211
unittest
212212
{
213-
static assert(!__traits(compiles, GitRepo()));
213+
//static assert(!__traits(compiles, GitRepo()));
214214
}
215215

216216
// internal
@@ -241,13 +241,13 @@ struct GitRepo
241241
unittest
242242
{
243243
// throw when path does not exist
244-
assertThrown!GitException(GitRepo(r".\invalid\path\.git"));
244+
assertThrown!GitException(openRepository(r".\invalid\path\.git"));
245245

246246
// open using the path of the .git directory
247-
auto repo1 = GitRepo(_testRepo);
247+
auto repo1 = openRepository(_testRepo);
248248

249249
// open using the base path of the .git directory
250-
auto repo2 = GitRepo(_testRepo.dirName);
250+
auto repo2 = openRepository(_testRepo.dirName);
251251
}
252252

253253
@property GitReference head()
@@ -272,7 +272,7 @@ struct GitRepo
272272
unittest
273273
{
274274
// by default test repo's HEAD is pointing to a commit
275-
auto repo1 = GitRepo(_testRepo);
275+
auto repo1 = openRepository(_testRepo);
276276
assert(repo1.isHeadDetached);
277277

278278
// new repo does not have a detached head
@@ -299,7 +299,7 @@ struct GitRepo
299299
///
300300
unittest
301301
{
302-
auto repo1 = GitRepo(_testRepo);
302+
auto repo1 = openRepository(_testRepo);
303303
assert(!repo1.isHeadOrphan);
304304

305305
// new repo has orphan branch
@@ -323,7 +323,7 @@ struct GitRepo
323323
unittest
324324
{
325325
// existing repo is non-empty
326-
auto repo1 = GitRepo(_testRepo);
326+
auto repo1 = openRepository(_testRepo);
327327
assert(!repo1.isEmpty);
328328

329329
// new repo is empty
@@ -344,7 +344,7 @@ struct GitRepo
344344
unittest
345345
{
346346
// existing repo is not bare
347-
auto repo = GitRepo(_testRepo);
347+
auto repo = openRepository(_testRepo);
348348
assert(!repo.isBare);
349349
}
350350

@@ -384,7 +384,7 @@ struct GitRepo
384384
unittest
385385
{
386386
// existing repo path
387-
auto repo = GitRepo(_testRepo);
387+
auto repo = openRepository(_testRepo);
388388
assert(repo.path.relativePath.toPosixPath == "../.git/modules/test/repo");
389389
}
390390

@@ -424,7 +424,7 @@ struct GitRepo
424424
{
425425
// existing repo work path is different to the path of the .git directory,
426426
// since this repo is a submodule
427-
auto repo = GitRepo(_testRepo);
427+
auto repo = openRepository(_testRepo);
428428
assert(repo.workPath.relativePath.toPosixPath == "../test/repo");
429429
}
430430

0 commit comments

Comments
 (0)