From 2dd6ab16c2346a7d7ed8f9b740f33457573dfdd7 Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Fri, 1 Apr 2022 14:09:36 +0200 Subject: Add repo.GitDirPath() and use it --- internal/rtree/repo.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/rtree/repo.go') diff --git a/internal/rtree/repo.go b/internal/rtree/repo.go index 59f3811..f710666 100644 --- a/internal/rtree/repo.go +++ b/internal/rtree/repo.go @@ -49,6 +49,11 @@ func (r Repo) AbsolutePath() string { return filepath.Join(RootPath, r.CheckoutPath) } +//GitDirPath returns the path of the .git directory of this repo. +func (r Repo) GitDirPath() string { + return filepath.Join(r.AbsolutePath(), ".git") +} + //NewRepoFromAbsolutePath initializes a Repo instance by scanning the existing //checkout at the given path. func NewRepoFromAbsolutePath(path string) (repo Repo, err error) { -- cgit v1.3.1