From 0750ea6d243cdca6e997da4b2c65bdb0e4dab404 Mon Sep 17 00:00:00 2001 From: Anders Hoff Date: Wed, 24 May 2017 22:52:23 +0200 Subject: [PATCH] add top_level attr --- fn/fn.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fn/fn.py b/fn/fn.py index 1c0a4c8..195b664 100644 --- a/fn/fn.py +++ b/fn/fn.py @@ -68,7 +68,9 @@ def __init_repo(self): from git.repo import Repo try: - self.repo = Repo(self.cwd, search_parent_directories=True) + repo = Repo(self.cwd, search_parent_directories=True) + self.top_level = repo.git.rev_parse('--show-toplevel') + self.repo = repo # self.top_level = self.repo.git.rev_parse('--show-toplevel') except Exception: # git sha will be '' if we are not in a git repo