Skip to content

Commit 903800a

Browse files
author
Peter Birch
committed
Fixing issue with HgWeb import where an empty repository causes lockup
1 parent 9edd313 commit 903800a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SourceHgWeb/SourceHgWeb.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ private function commit_changeset( $p_repo, $p_input, $p_branch='' ) {
251251
$i = 0;
252252

253253
# Skip changeset header
254-
while( strpos( $t_input[$i++], '# HG changeset patch' ) === false );
254+
while( $i < count( $t_input ) && strpos( $t_input[$i++], '# HG changeset patch' ) === false );
255+
256+
# Check we haven't exhausted the input
257+
if ( $i == count( $t_input )) return array (null, array());
255258

256259
# Process changeset metadata
257260
$t_commit = array();

0 commit comments

Comments
 (0)