#!/usr/bin/php
<?php

include('Hooks.php');
include('Colors.php');


$hook   = new Hooks();
$colors = new Colors();

$msg    = $hook->getCommitMsg($argv[1]);
$branch = $hook->getBranch();

if ($argv[2] == 'merge' && ($hook->checkBranch('master') || $hook->checkBranch('stage')) && $hook->checkMsg('Merge branch')) {
    echo $colors->getColoredString("\nMerge failed. You have to do fast-forward merge into " . substr($branch, 2) . ". Use git rebase " . substr($branch, 2) . " before merge.", "white", "red") . "\n";
        exit(1);
}
