diff --git a/includes/VersioncontrolGitRepository.php b/includes/VersioncontrolGitRepository.php index d4626a3..142596a 100644 --- a/includes/VersioncontrolGitRepository.php +++ b/includes/VersioncontrolGitRepository.php @@ -178,7 +178,7 @@ class VersioncontrolGitRepository extends VersioncontrolRepository { 'setDefaultBranch' => array($branch_name), 'save' => array(), ), - 'repository' => $this, + 'repository' => $this->repo_id, ); // Queue the write operation on the database an the repository. diff --git a/includes/plugins/reposync/VersioncontrolGitRepositoryHistorySynchronizerDefault.class.php b/includes/plugins/reposync/VersioncontrolGitRepositoryHistorySynchronizerDefault.class.php index d27d7ec..dccafd0 100644 --- a/includes/plugins/reposync/VersioncontrolGitRepositoryHistorySynchronizerDefault.class.php +++ b/includes/plugins/reposync/VersioncontrolGitRepositoryHistorySynchronizerDefault.class.php @@ -122,7 +122,8 @@ class VersioncontrolGitRepositoryHistorySynchronizerDefault implements Versionco $commits_db_hashes = $this->loadCommitHashes(); // Insert new commits in the database. - foreach (array_diff($commits_repo_hashes, $commits_db_hashes) as $hash) { + $commit_hashes_new = array_diff($commits_repo_hashes, $commits_db_hashes); + foreach ($commit_hashes_new as $hash) { $this->parseAndInsertCommit($hash, $branches_db, $tags_in_db_by_name, $options); } @@ -448,8 +449,7 @@ class VersioncontrolGitRepositoryHistorySynchronizerDefault implements Versionco $i = 0; while (true) { $line = $logs_tag_msg[$i + 6]; - if($logs_tag_msg[$i + 7] == 'ENDOFGITTAGOUTPUTMESAGEHERE') { - $message .= $line; + if ($line == 'ENDOFGITTAGOUTPUTMESAGEHERE') { break; } $message .= $line ."\n";