In the recently added gdb.src/pre-commit.exp test, we check if the
source directory is a git repository like this:
if {![file isdirectory $repodir/.git]} {
unsupported "Not in a git repository"
return
}
I make extensive use of git worktrees for development. In a worktree
.git is a file containing the location of the actual .git directory,
it is not itself a directory. As such, the above check fails,
claiming my source tree is not a git repository, when in fact, it is.
Fix this by relaxing the check to 'file exists $repodir/.git', which
will cover the directory and file case.
Approved-By: Kevin Buettner <kevinb@redhat.com>
set repodir $srcdir/../..
-if {![file isdirectory $repodir/.git]} {
+if {![file exists $repodir/.git]} {
unsupported "Not in a git repository"
return
}