chiark / gitweb /
test suite: Tolerate worktrees when trying to git-fsck
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 2 Aug 2017 18:32:51 +0000 (19:32 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 3 Aug 2017 21:41:51 +0000 (22:41 +0100)
A `git worktree' has a file for .git.  We still want to fsck them.  We
can simply run the fsck in the directory containing .git, instead.
That works for ordinary trees with a .git directory, and for
worktrees.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/lib

index 3c04155a2ddbe398ba480030186b1ab8add23186..4f268fc6a389b2dc5515fd976dba7597e7d02804 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -389,7 +389,7 @@ t-fscks () {
        (
        shopt -s nullglob
        for d in $tmp/*/.git $tmp/git/*.git; do
-               cd "$d"
+               cd "${d%/.git}"
                t-git-fsck
        done
        )