From: Andrew Burgess Date: Fri, 24 Oct 2025 21:14:56 +0000 (+0100) Subject: gdb/testsuite: fix git repository check in gdb.src/pre-commit.exp X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0633b78640dc892265d148f24881d544d4ddd16e;p=thirdparty%2Fbinutils-gdb.git gdb/testsuite: fix git repository check in gdb.src/pre-commit.exp 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 --- diff --git a/gdb/testsuite/gdb.src/pre-commit.exp b/gdb/testsuite/gdb.src/pre-commit.exp index 5fb0dfed6d7..8745b31272e 100644 --- a/gdb/testsuite/gdb.src/pre-commit.exp +++ b/gdb/testsuite/gdb.src/pre-commit.exp @@ -17,7 +17,7 @@ set repodir $srcdir/../.. -if {![file isdirectory $repodir/.git]} { +if {![file exists $repodir/.git]} { unsupported "Not in a git repository" return }