Skip to content

Commit 509b1c0

Browse files
committed
Use public interface for git-repo-info
1 parent f7b6d7b commit 509b1c0

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

lib/data-generators/git-commit.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ var Promise = require('ember-cli/lib/ext/promise');
44

55
module.exports = CoreObject.extend({
66
generate: function() {
7-
var path = gitRepoInfo._findRepo();
7+
var info = gitRepoInfo();
88

9-
if (path === null) {
9+
if (info === null || info.root === null) {
1010
return Promise.reject('Could not find git repository');
1111
}
1212

13-
var info = gitRepoInfo(path);
1413
var sha = info.sha.slice(0, 7);
1514

1615
if (!sha) {

lib/data-generators/git-tag-commit.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ var Promise = require('ember-cli/lib/ext/promise');
44

55
module.exports = CoreObject.extend({
66
generate: function() {
7-
var path = gitRepoInfo._findRepo();
7+
var info = gitRepoInfo();
88

9-
if (path === null) {
9+
if (info === null || info.root === null) {
1010
return Promise.reject('Could not find git repository');
1111
}
1212

13-
var info = gitRepoInfo(path);
1413
var tag = info.tag;
1514
var sha = info.sha.slice(0, 8);
1615

lib/data-generators/version-commit.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ module.exports = CoreObject.extend({
1515
generate: function() {
1616
var versionFile = this._plugin.readConfig('versionFile');
1717

18-
var path = gitRepoInfo._findRepo();
18+
var info = gitRepoInfo();
1919

20-
if (path === null) {
20+
if (info === null || info.root === null) {
2121
return Promise.reject('Could not find git repository');
2222
}
2323

24-
var info = gitRepoInfo(path);
2524
var sha = (info.sha || '').slice(0, 8);
2625
var plugin = this._plugin;
2726

0 commit comments

Comments
 (0)