Checks to see if current git branch has uncommitted changes.

@throws \Exception
Thrown if deploy.git.failOnDirty is TRUE and there are uncommitted
changes.
15905
protected function checkDirty() {
    $result = $this->taskExec('git status --porcelain')
      ->printMetadata(FALSE)
      ->printOutput(FALSE)
      ->interactive(FALSE)
      ->run();
    if (!$result->wasSuccessful()) {
      throw new BltException("Unable to determine if local git repository is dirty.");
    }

    $dirty = (bool) $result->getMessage();
    if ($dirty) {
      throw new BltException("There are uncommitted changes, commit or stash these changes before deploying.");
    }
  }
1082532
public function commit()
    {
        if (!$this->getIsActive()) {
            throw new Exception('Failed to commit transaction: transaction was inactive.');
        }

        $this->_level--;
        if ($this->_level === 0) {
            Log::debug('Commit transaction' . __METHOD__);
            $this->db->pdo->commit();
            $this->db->trigger(Connection::EVENT_COMMIT_TRANSACTION);
            return;
        }

        $schema = $this->db->getSchema();
        if ($schema->supportsSavepoint()) {
            Log::debug('Release savepoint ' . $this->_level . __METHOD__);
            $schema->releaseSavepoint('LEVEL' . $this->_level);
        } else {
            Log::info('Transaction not committed: nested transaction not supported' . __METHOD__);
        }
    }
100150
def check_git():
    """"""
    try:
        with open(os.devnull, "wb") as devnull:
            subprocess.check_call(["git", "--version"], stdout=devnull, stderr=devnull)
    except:
        raise RuntimeError("Please make sure git is installed and on your path.")
1193024
public static function checkOnDisk()
    {
        $args = func_get_args();
        if (count($args) == 2)
            $module = $args[0] . DIRECTORY_SEPARATOR . $args[1];
        elseif (count($args) == 1)
            $module = $args[1];
        else
            throw  new \Exception();
        $module = str_replace('\\', DIRECTORY_SEPARATOR, $module);
        return (bool)app('files')->exists(app_path('Modules') . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'Module.php');
    }
1004076
def _has_commit(version, debug=False):
    
    if _has_tag(version, debug) or _has_branch(version, debug):
        return False
    cmd = sh.git.bake('cat-file', '-e', version)
    try:
        util.run_command(cmd, debug=debug)
        return True
    except sh.ErrorReturnCode:
        return False
746058
protected function push()
    {
        // Check if push is enabled
        if (!Config::get('vdeploy::config.push')) {
            return true;
        }

        passthru('git push', $code);
        if ($code) {
            $this->error("FAILED: git push");
            return false;
        }

        passthru('git push --tags', $code);
        if ($code) {
            $this->error("Failed: git push --tags");
            return false;
        }

        return true;
    }
930541
protected function assertBranchMatchesUpstream($current_branch) {
    $branch_matches_upstream = $this->_exec("git diff $current_branch upstream/$current_branch --quiet")->wasSuccessful();
    if (!$branch_matches_upstream) {
      $this->logger->warning("$current_branch does not match upstream/$current_branch.");
      $this->logger->warning("Continuing will cause you to lose all local changes!");
      $continue = $this->confirm("Continue?");
      if (!$continue) {
        throw new BltException("Release terminated by user.");
      }
    }
  }
406767
public function transactionCommit()
    {
        if (empty($this->oDb)) {
            $this->connect();
        }

        try {

            $this->oDb->commit();
            $this->transactionRunning = false;

            return true;

        } catch (\Exception $e) {
            throw new TransactionException($e->getMessage(), $e->getCode());
        }
    }
1045538
public function isSuccessful(): bool
    {
        $failures = $this->getTotalFailures();
        $errors = $this->getTotalErrors();

        return $failures === 0 && $errors === 0;
    }
147236
def branch_exists(self, branch):
        """"""
        try:
            git(self.gitdir, self.gitwd, "rev-parse", branch)
        except sh.ErrorReturnCode:
            return False
        return True
1294053
private function hasUncommittedChanges($git)
    {
        $status = $git->status()->short()->getIndexStatus();

        if (empty($status)) {
            return false;
        }

        return true;
    }
264837
def release_check():
    """"""
    tags = local("git tag", capture=True)
    tags = set(tags.splitlines())
    if env.version in tags:
        raise Exception("Already released v. %r" % env.version)
638077
public function isDirty()
    {
        return true === $this->attributes->areDirty()
            || true === $this->hasOneEmbeds->areDirty()
            || true === $this->hasManyEmbeds->areDirty()
        ;
    }
292995
def verify_preconditions
      super

      if not gitlib.status.clean?
        GitProc::ChangeFileHelper.new(gitlib).offer_to_help_uncommitted_changes
      end

      raise ParkedChangesError.new(self) if gitlib.is_parked?
    end
643713
private function isValidForVersioning()
    {
        $dontVersionFields = isset( $this->dontVersionFields ) ? $this->dontVersionFields : [];
        $removeableKeys    = array_merge($dontVersionFields, [$this->getUpdatedAtColumn()]);

        if (method_exists($this, 'getDeletedAtColumn')) {
            $removeableKeys[] = $this->getDeletedAtColumn();
        }

        return ( count(array_diff_key($this->versionableDirtyData, array_flip($removeableKeys))) > 0 );
    }
734233
public function isDirty()
    {
        if (count($this) != $this->_original) {
            return true;
        }
        if (count($this->_deleted)) {
            return true;
        }
        foreach ($this as $model) {
            if (is_object($model)
                && ($model->isDirty() || $model->isNew())
            ) {
                return true;
            }
        }
        return false;
    }
948230
public function commit() {
		if (!$this->inTransaction()) {
			throw new Exception('There is no active transaction');
		}

		$res = @oci_commit($this->_dbh);
		$this->checkError($res);

		$this->_inTransaction = false;
		$this->_commitMode = null;

		return $res;
	}