From: Ian Jackson Date: Wed, 2 Aug 2017 18:32:51 +0000 (+0100) Subject: test suite: Tolerate worktrees when trying to git-fsck X-Git-Tag: archive/debian/4.1~21 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=090071ae8e31c8f81283af477c1114835ed8fd02;hp=98ff9fa866eecd50ce444ea7a506db894f2b5fac test suite: Tolerate worktrees when trying to git-fsck 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 --- diff --git a/tests/lib b/tests/lib index 3c04155a..4f268fc6 100644 --- 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 )