Skip to content

Commit 6346e31

Browse files
author
alexandresalome
committed
specify encoding in git log call #26
1 parent 7459fc2 commit 6346e31

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Gitonomy/Git/Log.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
namespace Gitonomy\Git;
1414

15+
use Gitonomy\Git\Util\StringHelper;
16+
1517
/**
1618
* @author Alexandre Salomé <[email protected]>
1719
*/
@@ -120,7 +122,7 @@ public function getCommits()
120122
$limit = null !== $this->limit ? '-n '.((int) $this->limit) : '';
121123
$revisions = null !== $this->revisions ? $this->revisions : '--all';
122124

123-
$args = array('--format=format:%H');
125+
$args = array('--encoding='.StringHelper::getEncoding(), '--format=format:%H');
124126

125127
if (null !== $this->offset) {
126128
$args[] = '--skip='.((int) $this->offset);

src/Gitonomy/Git/Util/StringHelper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ class StringHelper
2121
{
2222
private static $encoding = 'utf-8';
2323

24+
public static function getEncoding()
25+
{
26+
return self::$encoding;
27+
}
28+
2429
public static function setEncoding($encoding)
2530
{
2631
self::$encoding = $encoding;

0 commit comments

Comments
 (0)