mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-31 03:42:39 +00:00
config: move default merge-tool config into config/ directory
I'm about to add more default configs, so it will be good to collect them in one directory.
This commit is contained in:
parent
db0a524f7b
commit
b22a6db7e7
@ -72,12 +72,12 @@ fn env_base() -> config::Config {
|
|||||||
builder.build().unwrap()
|
builder.build().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_mergetool_config() -> config::Config {
|
fn default_config() -> config::Config {
|
||||||
// Syntax error in default config isn't a user error. That's why defaults are
|
// Syntax error in default config isn't a user error. That's why defaults are
|
||||||
// loaded by separate builder.
|
// loaded by separate builder.
|
||||||
config::Config::builder()
|
config::Config::builder()
|
||||||
.add_source(config::File::from_str(
|
.add_source(config::File::from_str(
|
||||||
include_str!("merge_tool_config.toml"),
|
include_str!("config/merge_tools.toml"),
|
||||||
config::FileFormat::Toml,
|
config::FileFormat::Toml,
|
||||||
))
|
))
|
||||||
.build()
|
.build()
|
||||||
@ -113,7 +113,7 @@ fn env_overrides() -> config::Config {
|
|||||||
|
|
||||||
pub fn read_config() -> Result<UserSettings, ConfigError> {
|
pub fn read_config() -> Result<UserSettings, ConfigError> {
|
||||||
let mut config_builder = config::Config::builder()
|
let mut config_builder = config::Config::builder()
|
||||||
.add_source(default_mergetool_config())
|
.add_source(default_config())
|
||||||
.add_source(env_base());
|
.add_source(env_base());
|
||||||
|
|
||||||
if let Some(config_path) = config_path()? {
|
if let Some(config_path) = config_path()? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user