This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed commit parsing with message line witout spaces
- Loading branch information
Vitalie Lazu
committed
Oct 18, 2013
1 parent
5f47795
commit 54cd7da
Showing
2 changed files
with
23 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package gogit | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
// Guard for runtime error: slice bounds out of range | ||
func TestParseCommitData(t *testing.T) { | ||
str := "tree 47e960bd3b10e549716c31badb1fc06aacd708e1\n" + | ||
"author Artiom <kron@example.com> 1379666165 +0300" + | ||
"committer Artiom <kron@example.com> 1379666165 +0300\n\n" + | ||
"if case if ClientForAction will return error, client can absent (be nil)\n\n" + | ||
"Conflicts:\n" + | ||
" app/class.js\n" | ||
|
||
commit, _ := parseCommitData([]byte(str)) | ||
|
||
if commit.treeId.String() != "47e960bd3b10e549716c31badb1fc06aacd708e1" { | ||
t.Fatalf("Got bad tree %s", commit.treeId) | ||
} | ||
} |