Skip to content

Commit ff72406

Browse files
authored
fix(changelog): don't change the context when provided via --from-context (#820)
closes /issues/819
1 parent 7415289 commit ff72406

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

git-cliff-core/src/changelog.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,20 @@ impl<'a> Changelog<'a> {
430430
}
431431
}
432432

433-
/// Adds remote data (e.g. GitHub commits) to the releases.
434-
pub fn add_remote_data(&mut self) -> Result<()> {
435-
debug!("Adding remote data...");
433+
/// Adds information about the remote to the template context.
434+
pub fn add_remote_context(&mut self) -> Result<()> {
436435
self.additional_context.insert(
437436
"remote".to_string(),
438437
serde_json::to_value(self.config.remote.clone())?,
439438
);
439+
Ok(())
440+
}
441+
442+
/// Adds remote data (e.g. GitHub commits) to the releases.
443+
pub fn add_remote_data(&mut self) -> Result<()> {
444+
debug!("Adding remote data...");
445+
self.add_remote_context()?;
446+
440447
#[cfg(feature = "github")]
441448
let (github_commits, github_pull_requests) = if self.config.remote.github.is_set()
442449
{

git-cliff/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ pub fn run(mut args: Opt) -> Result<()> {
535535
Box::new(File::open(context_path)?)
536536
};
537537
let mut changelog = Changelog::from_context(&mut input, &config)?;
538-
changelog.add_remote_data()?;
538+
changelog.add_remote_context()?;
539539
changelog
540540
} else {
541541
// Process the repositories.

0 commit comments

Comments
 (0)