diff options
| author | Danielle Adams <[email protected]> | 2018-06-27 20:31:44 -0400 |
|---|---|---|
| committer | Marak <[email protected]> | 2018-09-23 11:12:09 -0400 |
| commit | 200ab1321231e63be401917433cd651ba2df7c51 (patch) | |
| tree | 9fbcd37eb77dbee6f8ec4f21403f906bae20800e /lib/git.js | |
| parent | c29b9407064dbc14baa338f2ba9713d49b99e1dd (diff) | |
| download | faker-200ab1321231e63be401917433cd651ba2df7c51.tar.xz faker-200ab1321231e63be401917433cd651ba2df7c51.zip | |
add commit entry and remove readme changes
Diffstat (limited to 'lib/git.js')
| -rw-r--r-- | lib/git.js | 38 |
1 files changed, 30 insertions, 8 deletions
@@ -14,22 +14,29 @@ var Git = function(faker) { self.branch = function() { var noun = faker.hacker.noun().replace(' ', '-'); var verb = faker.hacker.verb().replace(' ', '-'); - return 'noun' + '-' + 'verb'; + return noun + '-' + verb; } /** - * commitSha + * commitEntry * - * @method faker.git.commitSha + * @method faker.git.commitEntry + * @param {object} options */ - self.commitSha = function() { - var commit = ""; + self.commitEntry = function(options) { + options = options || {}; - for (var i = 0; i < 40; i++) { - commit += faker.random.alphaNumeric(); + var entry = 'commit {{git.commitSha}}\r\n'; + + if (options.merge || (faker.random.number({ min: 0, max: 4 }) === 0)) { + entry += 'Merge: {{git.shortSha}} {{git.shortSha}}\r\n'; } - return commit; + entry += 'Author: {{name.firstName}} {{name.lastName}} <{{internet.email}}>\r\n'; + entry += 'Date: ' + faker.date.recent().toString() + '\r\n'; + entry += '\r\n\xa0\xa0\xa0\xa0{{git.commitMessage}}\r\n'; + + return f(entry); }; /** @@ -43,6 +50,21 @@ var Git = function(faker) { }; /** + * commitSha + * + * @method faker.git.commitSha + */ + self.commitSha = function() { + var commit = ""; + + for (var i = 0; i < 40; i++) { + commit += faker.random.alphaNumeric(); + } + + return commit; + }; + + /** * shortSha * * @method faker.git.shortSha |
