Skip to content

Commit 23cd98b

Browse files
author
alexandresalome
committed
rough support of submodules
1 parent b399fe8 commit 23cd98b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Gitonomy/Git/Parser/TreeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function doParse()
2323
$mode = $vars[0];
2424
$this->consume(' ');
2525

26-
$vars = $this->consumeRegexp('/(blob|tree)/A');
26+
$vars = $this->consumeRegexp('/(blob|tree|commit)/A');
2727
$type = $vars[0];
2828
$this->consume(' ');
2929

src/Gitonomy/Git/Tree.php

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

1313
namespace Gitonomy\Git;
1414

15+
use Gitonomy\Git\CommitReference;
1516
use Gitonomy\Git\Exception\InvalidArgumentException;
1617
use Gitonomy\Git\Exception\UnexpectedValueException;
1718

@@ -52,8 +53,10 @@ protected function initialize()
5253
list($mode, $type, $hash, $name) = $entry;
5354
if ($type == 'blob') {
5455
$this->entries[$name] = array($mode, $this->repository->getBlob($hash));
55-
} else {
56+
} elseif ($type == 'tree') {
5657
$this->entries[$name] = array($mode, $this->repository->getTree($hash));
58+
} else {
59+
$this->entries[$name] = array($mode, new CommitReference($hash));
5760
}
5861
}
5962

0 commit comments

Comments
 (0)