diff options
Diffstat (limited to 'modules/git/notes_test.go')
-rw-r--r-- | modules/git/notes_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/git/notes_test.go b/modules/git/notes_test.go index a954377f54..bf010b9a71 100644 --- a/modules/git/notes_test.go +++ b/modules/git/notes_test.go @@ -22,3 +22,17 @@ func TestGetNotes(t *testing.T) { assert.Equal(t, []byte("Note contents\n"), note.Message) assert.Equal(t, "Vladimir Panteleev", note.Commit.Author.Name) } + +func TestGetNestedNotes(t *testing.T) { + repoPath := filepath.Join(testReposDir, "repo3_notes") + repo, err := OpenRepository(repoPath) + assert.NoError(t, err) + + note := Note{} + err = GetNote(repo, "3e668dbfac39cbc80a9ff9c61eb565d944453ba4", ¬e) + assert.NoError(t, err) + assert.Equal(t, []byte("Note 2"), note.Message) + err = GetNote(repo, "ba0a96fa63532d6c5087ecef070b0250ed72fa47", ¬e) + assert.NoError(t, err) + assert.Equal(t, []byte("Note 1"), note.Message) +} |