Skip to content

Commit

Permalink
fix: handle merge commits
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Aug 9, 2019
1 parent f2d8d7f commit e3e1877
Show file tree
Hide file tree
Showing 36 changed files with 1,155 additions and 164 deletions.
724 changes: 724 additions & 0 deletions __snapshots__/blame-spec.js

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions __snapshots__/blame-spec.js.schema-shot
@@ -0,0 +1,82 @@
exports['gets blame for 1 line of this file 1'] = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"commit": {
"type": "string",
"required": true
},
"author": {
"type": "string",
"required": true
},
"committer": {
"type": "string",
"required": true
},
"summary": {
"type": "string",
"required": true
},
"filename": {
"type": "string",
"required": true
},
"line": {
"type": "string",
"required": true
}
},
"additionalProperties": false,
"list": false,
"example": {
"commit": "b2bf285c40b0c17743d84495b69c51d4c6367089",
"author": "Gleb Bahmutov",
"committer": "Gleb Bahmutov",
"summary": "mock test",
"filename": "spec/blame-spec.js",
"line": "\tconst la = require('lazy-ass')"
}
}

exports['can grab blame for entire file 1'] = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"commit": {
"type": "string",
"required": true
},
"author": {
"type": "string",
"required": true
},
"committer": {
"type": "string",
"required": true
},
"summary": {
"type": "string",
"required": true
},
"filename": {
"type": "string",
"required": true
},
"line": {
"type": "string",
"required": true
}
},
"additionalProperties": false,
"list": true,
"example": {
"commit": "b2bf285c40b0c17743d84495b69c51d4c6367089",
"author": "Gleb Bahmutov",
"committer": "Gleb Bahmutov",
"summary": "mock test",
"filename": "spec/blame-spec.js",
"line": "\tconst la = require('lazy-ass')"
}
}

13 changes: 13 additions & 0 deletions __snapshots__/commit-numstat-utils-spec.js
@@ -0,0 +1,13 @@
exports['parsing commit numstat regular commit 1'] = {
"commit": "0b3342816ac2db82d051233e884ff93ddb811b17",
"author": "Renovate Bot <bot@renovateapp.com>",
"date": "Sat Dec 22 22:15:32 2018 +0000",
"message": "chore(deps): update dependency mocked-env to v1.2.4"
}

exports['parsing commit numstat merged commit 1'] = {
"commit": "f2d8d7f2b2de0df9cfc14845d284521eb2513c0c",
"author": "Gleb Bahmutov <gleb.bahmutov@gmail.com>",
"date": "Fri Aug 9 10:59:17 2019 -0400",
"message": "fix: update lodash"
}
12 changes: 12 additions & 0 deletions __snapshots__/commits-spec.js
@@ -0,0 +1,12 @@
exports['commits all parses given output 1'] = [
{
"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"message": "first commit",
"body": ""
},
{
"id": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"message": "second commit",
"body": ""
}
]
21 changes: 21 additions & 0 deletions __snapshots__/one-line-log-spec.js
@@ -0,0 +1,21 @@
exports['one line log parses mock output 1'] = [
{
"id": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"message": "commit B"
},
{
"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"message": "commit A"
}
]

exports['one line log parses mock output with branch name 1'] = [
{
"id": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"message": "commit B"
},
{
"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"message": "commit A"
}
]
21 changes: 21 additions & 0 deletions __snapshots__/one-line-log-spec.js.schema-shot
@@ -0,0 +1,21 @@
exports['grabs last 5 commits schema 1'] = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"required": true
},
"message": {
"type": "string",
"required": true
}
},
"additionalProperties": false,
"list": true,
"example": {
"id": "f2d8d7f2b2de0df9cfc14845d284521eb2513c0c",
"message": "fix: update lodash"
}
}

136 changes: 76 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -80,7 +80,7 @@
"semantic-release": "8.2.3",
"simple-commit-message": "4.0.3",
"sinon": "6.3.5",
"snap-shot-it": "6.2.8",
"snap-shot-it": "7.8.0",
"standard": "11.0.1",
"stop-only": "2.2.1",
"stub-spawn-once": "2.3.0",
Expand Down

0 comments on commit e3e1877

Please sign in to comment.