if (!
$overwrite) { return false;
} if (!
filesize($file)) { return true;
} exec('git status --short --ignored --untracked-files=all -- '.ProcessExecutor::
escape($file).' 2>&1',
$output,
$status);
if (0 !==
$status) { return $this->io &&
$this->io->
askConfirmation(sprintf('Cannot determine the state of the "%s" file, overwrite anyway? [y/N] ',
$file), false
);
} if (empty($output[0
]) ||
preg_match('/^[ AMDRCU][ D][ \t]/',
$output[0
])) { return true;
} $name =
basename($file);
$name = \
strlen($output[0
]) - \
strlen($name) ===
strrpos($output[0
],
$name) ?
substr($output[0
], 3
) :
$name;
return $this->io &&
$this->io->
askConfirmation(sprintf('File "%s" has uncommitted changes, overwrite? [y/N] ',
$name), false
);
}