mirror of
https://github.com/orhun/git-cliff.git
synced 2024-11-29 13:32:20 +03:00
fix(changelog): don't change the context when provided via --from-context
(#820)
closes orhun/git-cliff/issues/819
This commit is contained in:
parent
741528994d
commit
ff7240633f
@ -430,13 +430,20 @@ impl<'a> Changelog<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds remote data (e.g. GitHub commits) to the releases.
|
||||
pub fn add_remote_data(&mut self) -> Result<()> {
|
||||
debug!("Adding remote data...");
|
||||
/// Adds information about the remote to the template context.
|
||||
pub fn add_remote_context(&mut self) -> Result<()> {
|
||||
self.additional_context.insert(
|
||||
"remote".to_string(),
|
||||
serde_json::to_value(self.config.remote.clone())?,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Adds remote data (e.g. GitHub commits) to the releases.
|
||||
pub fn add_remote_data(&mut self) -> Result<()> {
|
||||
debug!("Adding remote data...");
|
||||
self.add_remote_context()?;
|
||||
|
||||
#[cfg(feature = "github")]
|
||||
let (github_commits, github_pull_requests) = if self.config.remote.github.is_set()
|
||||
{
|
||||
|
@ -535,7 +535,7 @@ pub fn run(mut args: Opt) -> Result<()> {
|
||||
Box::new(File::open(context_path)?)
|
||||
};
|
||||
let mut changelog = Changelog::from_context(&mut input, &config)?;
|
||||
changelog.add_remote_data()?;
|
||||
changelog.add_remote_context()?;
|
||||
changelog
|
||||
} else {
|
||||
// Process the repositories.
|
||||
|
Loading…
Reference in New Issue
Block a user