From c78b4d665e406af7e8cba608f65ac2171d3917b6 Mon Sep 17 00:00:00 2001 From: Mark Probst Date: Wed, 4 Mar 2015 11:38:19 -0800 Subject: Cherrypick --- git_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git_test.go') 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() -- cgit v1.2.3