diff options
author | Richard Genoud <richard.genoud@gmail.com> | 2014-02-10 17:25:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-10 19:01:40 -0500 |
commit | 3645e3283b90524ed9a6b33b68c93ee29d1bfeb9 (patch) | |
tree | 0f634b2d3600ce5d187084027ba1959c77379805 /scripts | |
parent | ec83b616a71d76cc062371339472ed66ba405824 (diff) |
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: Richard Genoud <richard.genoud@gmail.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0ea2a1e24ade..464dcef79b35 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -471,7 +471,7 @@ sub seed_camelcase_includes { | |||
471 | 471 | ||
472 | $camelcase_seeded = 1; | 472 | $camelcase_seeded = 1; |
473 | 473 | ||
474 | if (-d ".git") { | 474 | if (-e ".git") { |
475 | my $git_last_include_commit = `git log --no-merges --pretty=format:"%h%n" -1 -- include`; | 475 | my $git_last_include_commit = `git log --no-merges --pretty=format:"%h%n" -1 -- include`; |
476 | chomp $git_last_include_commit; | 476 | chomp $git_last_include_commit; |
477 | $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; | 477 | $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; |
@@ -499,7 +499,7 @@ sub seed_camelcase_includes { | |||
499 | return; | 499 | return; |
500 | } | 500 | } |
501 | 501 | ||
502 | if (-d ".git") { | 502 | if (-e ".git") { |
503 | $files = `git ls-files "include/*.h"`; | 503 | $files = `git ls-files "include/*.h"`; |
504 | @include_files = split('\n', $files); | 504 | @include_files = split('\n', $files); |
505 | } | 505 | } |