1
1
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:
Albrecht 2024-08-26 20:07:19 +02:00 committed by GitHub
parent 741528994d
commit ff7240633f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View File

@ -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()
{

View File

@ -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.