Skip to content

Commit fc9fba7

Browse files
committed
fix(smartlog): respect --color always
1 parent a565ce9 commit fc9fba7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

git-branchless-lib/src/core/formatting.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,13 @@ fn render_style_as_ansi(content: &str, style: Style) -> eyre::Result<String> {
370370
output
371371
};
372372

373+
// `StyledObject` will try to do its own detection of whether or not it
374+
// should render ANSI escape codes. Disable that detection and use whatever
375+
// we've determined, so that the user can force color on or off. (The caller
376+
// will only call this function if the user wants color, so we pass `true`.)
377+
// See https://github.com/arxanas/git-branchless/issues/506
378+
let output = output.force_styling(true);
379+
373380
Ok(output.to_string())
374381
}
375382

0 commit comments

Comments
 (0)