Commit 3645e328 authored by Richard Genoud's avatar Richard Genoud Committed by Linus Torvalds

checkpatch: fix detection of git repository

Since git v1.7.7, the .git directory can be a file when, for example,
the kernel is a submodule of another git super project.  So, the check
"-d .git" is not working anymore in this case.  Using a more generic
check like "-e .git" corrects this behaviour.
Signed-off-by: default avatarRichard Genoud <>
Cc: Andy Whitcroft <>
Cc: Joe Perches <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent ec83b616
......@@ -471,7 +471,7 @@ sub seed_camelcase_includes {
$camelcase_seeded = 1;
if (-d ".git") {
if (-e ".git") {
my $git_last_include_commit = `git log --no-merges --pretty=format:"%h%n" -1 -- include`;
chomp $git_last_include_commit;
$camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit";
......@@ -499,7 +499,7 @@ sub seed_camelcase_includes {
if (-d ".git") {
if (-e ".git") {
$files = `git ls-files "include/*.h"`;
@include_files = split('\n', $files);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment