diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-03-15 01:09:11 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-03-15 01:09:11 +0100 |
| commit | 137c4fc3c838a803dddeb2855e726fc30713fdea (patch) | |
| tree | cc2bbc371b93ed92d4b2f3a1abc2a62d6d578277 /git_test.go | |
| parent | 063bed33a90e7d5b1ece1b6bd1aba04a69a78a28 (diff) | |
| parent | 76d600f7b3633f78e5f1433c16eba4eddfdad3e0 (diff) | |
Merge branch 'master' into v22
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() |
