-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(git): handle boundary field in blame
- Loading branch information
1 parent
1182c6e
commit 11f59a0
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ const expected = [ | |
author: { name: "foo", mail: "<[email protected]>", time: 1, tz: 1 }, | ||
committer: { name: "foo", mail: "<[email protected]>", time: 1, tz: 1 }, | ||
summary: "feat: initial commit", | ||
boundary: false, | ||
previous: null, | ||
filename: "foo.ts", | ||
content: "console.log('Hello, World!')", | ||
|
@@ -16,10 +17,21 @@ const expected = [ | |
author: { name: "bar", mail: "<[email protected]>", time: 2, tz: -1 }, | ||
committer: { name: "bar", mail: "<[email protected]>", time: 2, tz: -1 }, | ||
summary: "fix: add a comment", | ||
boundary: false, | ||
previous: "a".repeat(40), | ||
filename: "foo.ts", | ||
content: "// Say hello !", | ||
}, | ||
{ | ||
sha: "c".repeat(40), | ||
author: { name: "qux", mail: "<[email protected]>", time: 3, tz: 0 }, | ||
committer: { name: "quux", mail: "<[email protected]>", time: 3, tz: 0 }, | ||
summary: "chore: update README", | ||
boundary: true, | ||
previous: null, | ||
filename: "README.md", | ||
content: "# Hello, World!", | ||
}, | ||
] as BlameEntry[] | ||
|
||
function format(entries: BlameEntry[]) { | ||
|
@@ -35,6 +47,7 @@ function format(entries: BlameEntry[]) { | |
`committer-time ${entry.committer.time}`, | ||
`committer-tz ${entry.committer.tz}`, | ||
`summary ${entry.summary}`, | ||
entry.boundary ? "boundary" : "", | ||
entry.previous ? `previous ${entry.previous}` : "", | ||
`filename ${entry.filename}`, | ||
`\t${entry.content}`, | ||
|