JakeMerdichAMD created this revision. JakeMerdichAMD added reviewers: MyDeveloperDay, krasimir, sammccall. Herald added a project: clang. Herald added a subscriber: cfe-commits.
https://bugs.llvm.org/show_bug.cgi?id=46043 Git's config is generally of the format 'key=val', but a setting 'key=true' can be written as just 'key'. The git-clang-format script expects a value and crashes in this case; this change handles implicit 'true' values in the script. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D80486 Files: clang/tools/clang-format/git-clang-format Index: clang/tools/clang-format/git-clang-format =================================================================== --- clang/tools/clang-format/git-clang-format +++ clang/tools/clang-format/git-clang-format @@ -192,7 +192,12 @@ out = {} for entry in run('git', 'config', '--list', '--null').split('\0'): if entry: - name, value = entry.split('\n', 1) + if '\n' in entry: + name, value = entry.split('\n', 1) + else: + # A setting with no '=' ('\n' with --null) is implicitly 'true' + name = entry + value = 'true' if name in non_string_options: value = run('git', 'config', non_string_options[name], name) out[name] = value
Index: clang/tools/clang-format/git-clang-format =================================================================== --- clang/tools/clang-format/git-clang-format +++ clang/tools/clang-format/git-clang-format @@ -192,7 +192,12 @@ out = {} for entry in run('git', 'config', '--list', '--null').split('\0'): if entry: - name, value = entry.split('\n', 1) + if '\n' in entry: + name, value = entry.split('\n', 1) + else: + # A setting with no '=' ('\n' with --null) is implicitly 'true' + name = entry + value = 'true' if name in non_string_options: value = run('git', 'config', non_string_options[name], name) out[name] = value
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits