summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-12-25 19:08:40 +0000
committerArun Isaac2022-12-25 23:33:05 +0000
commit998a13eb34e148cfff83f2b5b1ee5e3f39053d50 (patch)
tree0d2216e53e3d9ed713a754b44b633702ad75c08e
parentf9eb75cb09184a9cfca75d42c9f27e0ac693847e (diff)
downloadtissue-998a13eb34e148cfff83f2b5b1ee5e3f39053d50.tar.gz
tissue-998a13eb34e148cfff83f2b5b1ee5e3f39053d50.tar.lz
tissue-998a13eb34e148cfff83f2b5b1ee5e3f39053d50.zip
git: Find git top level correctly even in bare repositories.
* tissue/git.scm (git-top-level): Find git top level correctly even in bare repositories.
-rw-r--r--tissue/git.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/tissue/git.scm b/tissue/git.scm
index 334ffbc..c837da7 100644
--- a/tissue/git.scm
+++ b/tissue/git.scm
@@ -93,7 +93,11 @@ directory."
(define (git-top-level)
"Return the top-level directory of the current git repository."
- (dirname (repository-directory (current-git-repository))))
+ (let ((repository-directory
+ (repository-directory (current-git-repository))))
+ (if (repository-bare? (current-git-repository))
+ repository-directory
+ (dirname repository-directory))))
(define (head-tree repository)
"Return tree of HEAD in REPOSITORY."