@@ -31,7 +31,7 @@ func TestNewRepoGetsCreatedWithAbsolutePath(t *testing.T) {
3131
3232func TestNoAdditionsBetweenSameRef (t * testing.T ) {
3333 doInRepoWithCommit (func (git * git_testing.GitTesting ) {
34- assert .Len (t , RepoLocatedAt (git .GetRoot ()).AdditionsWithinRange ("HEAD" , "HEAD" ), 0 ,
34+ assert .Len (t , RepoLocatedAt (git .Root ()).AdditionsWithinRange ("HEAD" , "HEAD" ), 0 ,
3535 "There should be no additions between a ref and itself." )
3636 })
3737}
@@ -42,7 +42,7 @@ func TestGetDiffForStagedFiles(t *testing.T) {
4242 git .CreateFileWithContents ("new.txt" , "created contents" )
4343 git .Add ("a.txt" )
4444 git .Add ("new.txt" )
45- repo := RepoLocatedAt (git .GetRoot ())
45+ repo := RepoLocatedAt (git .Root ())
4646 additions := repo .GetDiffForStagedFiles ()
4747
4848 if assert .Len (t , additions , 2 ) {
@@ -80,7 +80,7 @@ func TestGetDiffForStagedFilesWithSpacesInPath(t *testing.T) {
8080 doInRepoWithCommit (func (git * git_testing.GitTesting ) {
8181 git .AppendFileContent ("folder b/c.txt" , "New content.\n " , "Spanning multiple lines, even." )
8282 git .Add ("folder b/c.txt" )
83- repo := RepoLocatedAt (git .GetRoot ())
83+ repo := RepoLocatedAt (git .Root ())
8484 additions := repo .GetDiffForStagedFiles ()
8585
8686 if assert .Len (t , additions , 1 ) {
@@ -109,7 +109,7 @@ func TestAdditionsReturnsEditsAndAdds(t *testing.T) {
109109 git .CreateFileWithContents ("new.txt" , "created contents" )
110110 git .AddAndcommit ("*" , "added to lorem-ipsum content with my own stuff!" )
111111
112- additions := RepoLocatedAt (git .GetRoot ()).additionsInLastCommit ()
112+ additions := RepoLocatedAt (git .Root ()).additionsInLastCommit ()
113113 assert .Len (t , additions , 2 )
114114 assert .True (t , strings .HasSuffix (string (additions [0 ].Data ), "New content.\n Spanning multiple lines, even." ))
115115 })
@@ -120,15 +120,15 @@ func TestNewlyAddedFilesAreCountedAsChanges(t *testing.T) {
120120 git .CreateFileWithContents ("h" , "Hello" )
121121 git .CreateFileWithContents ("foo/bar/w" , ", World!" )
122122 git .AddAndcommit ("*" , "added hello world" )
123- assert .Len (t , RepoLocatedAt (git .GetRoot ()).additionsInLastCommit (), 2 )
123+ assert .Len (t , RepoLocatedAt (git .Root ()).additionsInLastCommit (), 2 )
124124 })
125125}
126126
127127func TestOutgoingContentOfNewlyAddedFilesIsAvailableInChanges (t * testing.T ) {
128128 doInRepoWithCommit (func (git * git_testing.GitTesting ) {
129129 git .CreateFileWithContents ("foo/bar/w" , "new contents" )
130130 git .AddAndcommit ("*" , "added new files" )
131- repo := RepoLocatedAt (git .GetRoot ())
131+ repo := RepoLocatedAt (git .Root ())
132132 assert .Len (t , repo .additionsInLastCommit (), 1 )
133133 assert .True (t , strings .HasSuffix (string (repo .AdditionsWithinRange ("HEAD~1" , "HEAD" )[0 ].Data ), "new contents" ))
134134 })
@@ -138,7 +138,7 @@ func TestOutgoingContentOfModifiedFilesIsAvailableInChanges(t *testing.T) {
138138 doInRepoWithCommit (func (git * git_testing.GitTesting ) {
139139 git .AppendFileContent ("a.txt" , "New content.\n " , "Spanning multiple lines, even." )
140140 git .AddAndcommit ("a.txt" , "added to lorem-ipsum content with my own stuff!" )
141- repo := RepoLocatedAt (git .GetRoot ())
141+ repo := RepoLocatedAt (git .Root ())
142142 assert .Len (t , repo .additionsInLastCommit (), 1 )
143143 assert .True (t , strings .HasSuffix (string (repo .additionsInLastCommit ()[0 ].Data ), "New content.\n Spanning multiple lines, even." ))
144144 })
@@ -152,7 +152,7 @@ func TestMultipleOutgoingChangesToTheSameFileAreAvailableInAdditions(t *testing.
152152 git .AppendFileContent ("a.txt" , "More new content.\n " )
153153 git .AddAndcommit ("a.txt" , "added some more new content" )
154154
155- repo := RepoLocatedAt (git .GetRoot ())
155+ repo := RepoLocatedAt (git .Root ())
156156 assert .Len (t , repo .additionsInLastCommit (), 1 )
157157 assert .True (t , strings .HasSuffix (string (repo .AdditionsWithinRange ("HEAD~2" , "HEAD" )[0 ].Data ), "New content.\n More new content.\n " ))
158158 })
@@ -162,14 +162,14 @@ func TestContentOfDeletedFilesIsNotAvailableInChanges(t *testing.T) {
162162 doInRepoWithCommit (func (git * git_testing.GitTesting ) {
163163 git .RemoveFile ("a.txt" )
164164 git .AddAndcommit ("a.txt" , "Deleted this file. After all, it only had lorem-ipsum content." )
165- assert .Equal (t , 0 , len (RepoLocatedAt (git .GetRoot ()).additionsInLastCommit ()),
165+ assert .Equal (t , 0 , len (RepoLocatedAt (git .Root ()).additionsInLastCommit ()),
166166 "There should be no additions because there is only an outgoing deletion" )
167167 })
168168}
169169
170170func TestDiffContainingBinaryFileChangesDoesNotBlowUp (t * testing.T ) {
171171 doInRepoWithCommit (func (git * git_testing.GitTesting ) {
172- repo := RepoLocatedAt (git .GetRoot ())
172+ repo := RepoLocatedAt (git .Root ())
173173 exec .Command ("cp" , "./pixel.jpg" , repo .root ).Run ()
174174 git .AddAndcommit ("pixel.jpg" , "Testing binary diff." )
175175 assert .Len (t , repo .additionsInLastCommit (), 1 )
@@ -185,7 +185,7 @@ func TestStagedAdditionsIncludeStagedFiles(t *testing.T) {
185185 git .AppendFileContent ("a.txt" , "More new content\n " )
186186 git .AppendFileContent ("alice/bob/b.txt" , "New content to b\n " )
187187
188- stagedAdditions := RepoLocatedAt (git .GetRoot ()).StagedAdditions ()
188+ stagedAdditions := RepoLocatedAt (git .Root ()).StagedAdditions ()
189189 assert .Len (t , stagedAdditions , 1 )
190190 assert .Equal (t , "a.txt" , string (stagedAdditions [0 ].Name ))
191191 assert .Equal (t , "New content.\n " , string (stagedAdditions [0 ].Data ))
@@ -197,7 +197,7 @@ func TestStagedAdditionsIncludeStagedNewFiles(t *testing.T) {
197197 git .CreateFileWithContents ("new.txt" , "New content.\n " )
198198 git .Add ("new.txt" )
199199
200- stagedAdditions := RepoLocatedAt (git .GetRoot ()).StagedAdditions ()
200+ stagedAdditions := RepoLocatedAt (git .Root ()).StagedAdditions ()
201201 assert .Len (t , stagedAdditions , 1 )
202202 assert .Equal (t , "new.txt" , string (stagedAdditions [0 ].Name ))
203203 assert .Equal (t , "New content.\n " , string (stagedAdditions [0 ].Data ))
@@ -209,7 +209,7 @@ func TestStagedAdditionsShouldNotIncludeDeletedFiles(t *testing.T) {
209209 git .RemoveFile ("a.txt" )
210210 git .Add ("." )
211211
212- stagedAdditions := RepoLocatedAt (git .GetRoot ()).StagedAdditions ()
212+ stagedAdditions := RepoLocatedAt (git .Root ()).StagedAdditions ()
213213 assert .Len (t , stagedAdditions , 0 )
214214 })
215215}
0 commit comments