refactor(3p/nix): Apply clang-tidy's readability-* fixes
This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
This commit is contained in:
parent
d331d3a0b5
commit
689ef502f5
78 changed files with 863 additions and 792 deletions
11
third_party/nix/src/libstore/ssh.cc
vendored
11
third_party/nix/src/libstore/ssh.cc
vendored
|
|
@ -12,7 +12,7 @@ SSHMaster::SSHMaster(const std::string& host, std::string keyFile,
|
|||
useMaster(useMaster && !fakeSSH),
|
||||
compress(compress),
|
||||
logFD(logFD) {
|
||||
if (host == "" || hasPrefix(host, "-")) {
|
||||
if (host.empty() || hasPrefix(host, "-")) {
|
||||
throw Error("invalid SSH host name '%s'", host);
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,8 @@ std::unique_ptr<SSHMaster::Connection> SSHMaster::startCommand(
|
|||
const std::string& command) {
|
||||
Path socketPath = startMaster();
|
||||
|
||||
Pipe in, out;
|
||||
Pipe in;
|
||||
Pipe out;
|
||||
in.create();
|
||||
out.create();
|
||||
|
||||
|
|
@ -63,9 +64,9 @@ std::unique_ptr<SSHMaster::Connection> SSHMaster::startCommand(
|
|||
if (fakeSSH) {
|
||||
args = {"bash", "-c"};
|
||||
} else {
|
||||
args = {"ssh", host.c_str(), "-x", "-a"};
|
||||
args = {"ssh", host, "-x", "-a"};
|
||||
addCommonSSHOpts(args);
|
||||
if (socketPath != "") {
|
||||
if (!socketPath.empty()) {
|
||||
args.insert(args.end(), {"-S", socketPath});
|
||||
}
|
||||
// TODO(tazjin): Abseil verbosity flag
|
||||
|
|
@ -123,7 +124,7 @@ Path SSHMaster::startMaster() {
|
|||
throw SysError("duping over stdout");
|
||||
}
|
||||
|
||||
Strings args = {"ssh", host.c_str(),
|
||||
Strings args = {"ssh", host,
|
||||
"-M", "-N",
|
||||
"-S", state->socketPath,
|
||||
"-o", "LocalCommand=echo started",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue