diff options
| author | Mark Probst <[email protected]> | 2015-03-04 11:38:19 -0800 |
|---|---|---|
| committer | Mark Probst <[email protected]> | 2015-03-04 15:52:54 -0800 |
| commit | c78b4d665e406af7e8cba608f65ac2171d3917b6 (patch) | |
| tree | e37a40954d28fc7bd397f6f4596ab0535e0d371b /git_test.go | |
| parent | 56ed0b22d7f7ab6185f14e0054346da3ca33c4fa (diff) | |
Cherrypick
Diffstat (limited to 'git_test.go')
| -rw-r--r-- | git_test.go | 6 |
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() |
