aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/git.py')
-rw-r--r--libbe/git.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/libbe/git.py b/libbe/git.py
index 398585f..5c377fd 100644
--- a/libbe/git.py
+++ b/libbe/git.py
@@ -102,7 +102,10 @@ def git_repo_for_path(path):
"""Find the root of the deepest repository containing path."""
# Assume that nothing funny is going on; in particular, that we aren't
# dealing with a bare repo.
- return os.path.dirname(git_dir_for_path(path))
+ dirname = os.path.dirname(git_dir_for_path(path))
+ if dirname == '' : # os.path.dirname('filename') == ''
+ dirname = '.'
+ return dirname
def git_dir_for_path(path):
"""Find the git-dir of the deepest repo containing path."""