sapling/eden/fs/config/MountProtocol.h
Xavier Deguillard 27e74c2ed1 config: fix use of uninitialized member in testharness
Summary:
The MountProtocol in CheckoutConfig may be read on macOS to test if an NFS
mount should be created instead of a FUSE mount. Unfortunately, since
testharness doesn't create valid config, the
CheckoutConfig::loadFromClientDirectory function is not used, and thus the
mountProtocol_ field is never initialized.

In practice, the test InodeMap.invalidInodeNumber was flaky on macOS due to
this issue.

Reviewed By: kmancini

Differential Revision: D37841713

fbshipit-source-id: 49b160869d0e682b09ebd246b94e6f4dc999a8e5
2022-07-14 12:46:22 -07:00

34 lines
744 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include "eden/fs/config/FieldConverter.h"
namespace facebook::eden {
enum class MountProtocol {
FUSE,
PRJFS,
NFS,
};
constexpr MountProtocol kMountProtocolDefault =
folly::kIsWindows ? MountProtocol::PRJFS : MountProtocol::FUSE;
template <>
class FieldConverter<MountProtocol> {
public:
folly::Expected<MountProtocol, std::string> fromString(
folly::StringPiece value,
const std::map<std::string, std::string>& convData) const;
std::string toDebugString(MountProtocol value) const;
};
} // namespace facebook::eden