Skip to main content

checkout_http_host

Function checkout_http_host 

Source
pub fn checkout_http_host(
    flag: Option<&str>,
    root: &Path,
) -> (String, HostOrigin)
Expand description

The machine’s interface for one checkout: a linked worktree does not take the one HTTP_HOST_ENV names. The variable is the machine’s face on its network, and that face is the repository’s primary server — the one other machines dial and whose mesh the worktrees cooperate through; a worktree’s own server serves its own sessions, and a variable inherited by every shell would otherwise put each of them on the network beside it. A flag still binds where it says, because a person typed it.

use majordomus_cli::cli::{checkout_http_host, HostOrigin};
// a directory that is not a linked worktree reads the machine's resolution unchanged
let plain = tempfile::tempdir().unwrap();
assert_eq!(
    checkout_http_host(Some("10.0.0.1"), plain.path()),
    ("10.0.0.1".to_string(), HostOrigin::Flag)
);