================
@@ -45,7 +45,15 @@ class DiskBackedIndexStorage : public BackgroundIndexStorage
{
if (EC != OK) {
elog("Failed to create directory {0} for index storage: {1}",
DiskShardRoot, EC.message());
+ return;
}
+ // Create a .gitignore file in the directory to ignore all files.
+ llvm::SmallString<128> GitignorePath(DiskShardRoot);
+ llvm::sys::path::append(GitignorePath, ".gitignore");
+ (void)llvm::writeToOutput(GitignorePath, [](llvm::raw_ostream &OS) {
+ OS << "# This file is autogenerated by clangd.\n*\n";
+ return llvm::Error::success();
+ });
----------------
sweiglbosker wrote:
You need to consume the error, ignoring it will cause a panic.
```suggestion
llvm::sys::path::append(GitignorePath, ".gitignore");
auto Res = llvm::writeToOutput(GitignorePath, [](llvm::raw_ostream &OS) {
OS << "# This file is autogenerated by clangd.\n*\n";
return llvm::Error::success();
});
llvm::consumeError(std::move(Res));
```
https://github.com/llvm/llvm-project/pull/170003
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits