subdir_done()
endif
-third_party_sources = [
- ':!contrib',
- ':!compat/inet_ntop.c',
- ':!compat/inet_pton.c',
- ':!compat/nedmalloc',
- ':!compat/obstack.*',
- ':!compat/poll',
- ':!compat/regex',
- ':!sha1collisiondetection',
- ':!sha1dc',
- ':!t/unit-tests/clar',
- ':!t/unit-tests/clar',
- ':!t/t[0-9][0-9][0-9][0-9]*',
-]
-
rules = [
'array.cocci',
'commit.cocci',
endforeach
coccinelle_headers = []
-foreach header : run_command(git, '-C', meson.project_source_root(), 'ls-files', '--deduplicate', '*.h', third_party_sources, check: true).stdout().split()
+foreach header : headers_to_check
coccinelle_headers += meson.project_source_root() / header
endforeach
'builtin/write-tree.c',
]
+third_party_sources = [
+ ':!contrib',
+ ':!compat/inet_ntop.c',
+ ':!compat/inet_pton.c',
+ ':!compat/nedmalloc',
+ ':!compat/obstack.*',
+ ':!compat/poll',
+ ':!compat/regex',
+ ':!sha1collisiondetection',
+ ':!sha1dc',
+ ':!t/unit-tests/clar',
+ ':!t/unit-tests/clar',
+ ':!t/t[0-9][0-9][0-9][0-9]*',
+]
+
+headers_to_check = []
+if git.found() and fs.exists(meson.project_source_root() / '.git')
+ foreach header : run_command(git, '-C', meson.project_source_root(), 'ls-files', '--deduplicate', '*.h', third_party_sources, check: true).stdout().split()
+ headers_to_check += header
+ endforeach
+endif
+
if not get_option('breaking_changes')
builtin_sources += 'builtin/pack-redundant.c'
endif