scripts: Detect git worktrees for get_maintainer.pl --git
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 12 Nov 2019 03:45:32 +0000 (14:45 +1100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 Nov 2019 09:00:36 +0000 (10:00 +0100)
Recent git versions support worktrees where .git is not a directory but
a file with a path to the .git repository; however the get_maintainer.pl
script only recognises the .git directory, let's fix it.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Tested-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20191112034532.69079-1-aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/get_maintainer.pl

index 71415e3c706106958eb0a85cb98e921ba73077a9..27991eb1cfb4c31fa142f5db810c2dc2f96de7d5 100755 (executable)
@@ -81,7 +81,7 @@ my %VCS_cmds;
 
 my %VCS_cmds_git = (
     "execute_cmd" => \&git_execute_cmd,
-    "available" => '(which("git") ne "") && (-d ".git")',
+    "available" => '(which("git") ne "") && (-e ".git")',
     "find_signers_cmd" =>
        "git log --no-color --follow --since=\$email_git_since " .
            '--format="GitCommit: %H%n' .