Skip to content

Commit

Permalink
Fix getting Git history
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteMX committed Jun 29, 2017
1 parent 133e50b commit 9135bab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Empty file.
7 changes: 6 additions & 1 deletion _gulp/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const getCommits = (gitPath, file) => {
}).on('error', err => {
reject(err);
}).on('end', () => {
resolve(commits);
if (commits.length === 0) {
reject(`Not getting commits for ${gutil.colors.cyan(file)}, this should not happen. Is the file empty?`);
} else {
resolve(commits);
}
});
} catch (e) {
reject(`Error getting commits for ${gitPath}`);
Expand Down Expand Up @@ -75,6 +79,7 @@ const getLastCommit = (folder, filename) => {
gutil.log(`${git_indicator} No history found for ${gutil.colors.cyan(filename)}, skipping`);
resolve({})
} else {
gutil.log(`${git_indicator} ${err}`);
reject(err);
}
});
Expand Down

0 comments on commit 9135bab

Please sign in to comment.