diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-21 18:18:51 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-21 18:53:37 +0200 |
commit | 82eaceffc1d750832a2a66f206749d2dca968cce (patch) | |
tree | 1431c8f1fd9baa689b850da7f104d12c20b1d8a7 /commands/select/select.go | |
parent | 6a575fbf483e2b28821908f67e87637d9e5cea75 (diff) | |
download | git-bug-82eaceffc1d750832a2a66f206749d2dca968cce.tar.gz |
repo: split the Repo interface to avoid abstraction leak in RepoCache
Diffstat (limited to 'commands/select/select.go')
-rw-r--r-- | commands/select/select.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/commands/select/select.go b/commands/select/select.go index 5d6cee7f..203a2f1e 100644 --- a/commands/select/select.go +++ b/commands/select/select.go @@ -55,7 +55,7 @@ func ResolveBug(repo *cache.RepoCache, args []string) (*cache.BugCache, []string // Select will select a bug for future use func Select(repo *cache.RepoCache, id string) error { - selectPath := selectFilePath(repo.Repository()) + selectPath := selectFilePath(repo) f, err := os.OpenFile(selectPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666) if err != nil { @@ -72,13 +72,13 @@ func Select(repo *cache.RepoCache, id string) error { // Clear will clear the selected bug, if any func Clear(repo *cache.RepoCache) error { - selectPath := selectFilePath(repo.Repository()) + selectPath := selectFilePath(repo) return os.Remove(selectPath) } func selected(repo *cache.RepoCache) (*cache.BugCache, error) { - selectPath := selectFilePath(repo.Repository()) + selectPath := selectFilePath(repo) f, err := os.Open(selectPath) if err != nil { @@ -120,6 +120,6 @@ func selected(repo *cache.RepoCache) (*cache.BugCache, error) { return b, nil } -func selectFilePath(repo repository.Repo) string { +func selectFilePath(repo repository.RepoCommon) string { return path.Join(repo.GetPath(), ".git", "git-bug", selectFile) } |