Skip to content

Commit 5f58b81

Browse files
committed
Add test for linked worktrees result
1 parent b42f269 commit 5f58b81

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,26 @@ describe('git-repo-info', function() {
270270

271271
assert.deepEqual(result, expected);
272272
});
273+
274+
it('returns an object with repo info for linked worktrees', function() {
275+
process.chdir(path.join(testFixturesPath, 'linked-worktree', 'linked'));
276+
var result = repoInfo();
277+
278+
var expected = {
279+
branch: null,
280+
sha: '409372f3bd07c11bfacee3963f48571d675268d7',
281+
abbreviatedSha: '409372f3bd',
282+
tag: null,
283+
committer: null,
284+
committerDate: null,
285+
author: null,
286+
authorDate: null,
287+
commitMessage: null,
288+
root: path.join(testFixturesPath, 'linked-worktree')
289+
};
290+
291+
assert.deepEqual(result, expected);
292+
});
273293
});
274294

275295
describe('repoInfo().root', function() {

0 commit comments

Comments
 (0)