summaryrefslogtreecommitdiff
path: root/git_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'git_test.go')
-rw-r--r--git_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/git_test.go b/git_test.go
index 56adeed..b9cf0a9 100644
--- a/git_test.go
+++ b/git_test.go
@@ -57,6 +57,10 @@ func seedTestRepo(t *testing.T, repo *Repository) (*Oid, *Oid) {
return commitId, treeId
}
+func pathInRepo(repo *Repository, name string) string {
+ return path.Join(path.Dir(path.Dir(repo.Path())), name)
+}
+
func updateReadme(t *testing.T, repo *Repository, content string) (*Oid, *Oid) {
loc, err := time.LoadLocation("Europe/Berlin")
checkFatal(t, err)
@@ -67,7 +71,7 @@ func updateReadme(t *testing.T, repo *Repository, content string) (*Oid, *Oid) {
}
tmpfile := "README"
- err = ioutil.WriteFile(path.Join(path.Dir(path.Dir(repo.Path())), tmpfile), []byte(content), 0644)
+ err = ioutil.WriteFile(pathInRepo(repo, tmpfile), []byte(content), 0644)
checkFatal(t, err)
idx, err := repo.Index()