forked from atom/git-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for blame per issue atom#11
- Loading branch information
Gabriel Isenberg
committed
Sep 13, 2015
1 parent
3259d70
commit 03732bd
Showing
12 changed files
with
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref: refs/heads/master |
Binary file not shown.
Binary file added
BIN
+50 Bytes
spec/fixtures/blame.git/objects/23/54b25984ae1863618b2a37a6f6d327483e34e4
Binary file not shown.
Binary file added
BIN
+133 Bytes
spec/fixtures/blame.git/objects/7a/4a0f2a8c1168a2bf7800b0a5f64db64e090b27
Binary file not shown.
Binary file added
BIN
+64 Bytes
spec/fixtures/blame.git/objects/9e/2fa05995713a934a99c88accdbb8ec941f001b
Binary file not shown.
1 change: 1 addition & 0 deletions
1
spec/fixtures/blame.git/objects/a2/e56f1240cf8ee6fb4912b1fcb631a5d8254d46
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
x5���0�3�O�1=b)�;"��@�t��[����a���Rot�L6�U<��_U'�S�$.�TPD9\�����ό��)v�����% | ||
|
Binary file added
BIN
+50 Bytes
spec/fixtures/blame.git/objects/a3/59b0418fb6c52dd26d806a937b8903bdbf8531
Binary file not shown.
Binary file added
BIN
+163 Bytes
spec/fixtures/blame.git/objects/fc/fc9307b3c7864cbb8bbfe457f44d7a33202de4
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
fcfc9307b3c7864cbb8bbfe457f44d7a33202de4 |
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 |
---|---|---|
|
@@ -724,3 +724,24 @@ describe "git", -> | |
|
||
it "throws an error if the file doesn't exist", -> | ||
expect(-> repo.add('missing.txt')).toThrow() | ||
|
||
describe ".getBlame(path)", -> | ||
beforeEach -> | ||
repoDirectory = temp.mkdirSync('node-git-repo-') | ||
wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/blame.git'), path.join(repoDirectory, '.git')) | ||
repo = git.open(repoDirectory) | ||
|
||
it "returns the blame for the path", -> | ||
blame = repo.getBlame('a.txt') | ||
|
||
expect(blame.length).toBe 1 | ||
expect(blame[0].commitId).toBe 'fcfc9307b' | ||
expect(blame[0].startLineNumber).toBe 1 | ||
expect(blame[0].linesInHunk).toBe 3 | ||
expect(blame[0].signature.name).toBe 'Gabriel Isenberg' | ||
expect(blame[0].signature.email).toBe '[email protected]' | ||
expect(blame[0].signature.when.time).toBe 1442122439 | ||
expect(blame[0].signature.when.offset).toBe -420 | ||
|
||
it "throws an error if the file doesn't exist", -> | ||
expect(-> repo.getBlame('missing.txt')).toThrow() |
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