]> Dogcows Code - chaz/git-codeowners/blobdiff - lib/App/Codeowners/Formatter/String.pm
Version 0.49
[chaz/git-codeowners] / lib / App / Codeowners / Formatter / String.pm
index 334233132d8a0375a2ae9c0f10e9416638c91831..14b07a4096b2769881f9565eb575cfe5a41a3666 100644 (file)
@@ -5,13 +5,12 @@ package App::Codeowners::Formatter::String;
 use warnings;
 use strict;
 
-our $VERSION = '0.42'; # VERSION
+our $VERSION = '0.49'; # VERSION
 
 use parent 'App::Codeowners::Formatter';
 
 use App::Codeowners::Util qw(stringf zip);
 use Color::ANSI::Util 0.03 qw(ansifg);
-use Encode qw(encode);
 
 sub stream {
     my $self    = shift;
@@ -27,7 +26,7 @@ sub stream {
     );
 
     my $text = stringf($self->format, %info);
-    print { $self->handle } encode('UTF-8', $text), "\n";
+    print { $self->handle } $text, "\n";
 }
 
 sub _expand_filter_args {
@@ -54,7 +53,7 @@ sub _colored {
     my $text = shift;
     my $rgb  = shift or return $text;
 
-    return $text if $ENV{NO_COLOR};
+    return $text if $ENV{NO_COLOR} || (defined $ENV{COLOR_DEPTH} && !$ENV{COLOR_DEPTH});
 
     $rgb =~ s/^(.)(.)(.)$/$1$1$2$2$3$3/;
     if ($rgb !~ m/^[0-9a-fA-F]{6}$/) {
@@ -136,7 +135,7 @@ App::Codeowners::Formatter::String - Format codeowners output using printf-like
 
 =head1 VERSION
 
-version 0.42
+version 0.49
 
 =head1 DESCRIPTION
 
This page took 0.020783 seconds and 4 git commands to generate.