Changeset View
Changeset View
Standalone View
Standalone View
src/repository/state/ArcanistGitLocalState.php
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | protected function getIgnoreHints() { | ||||
return array( | return array( | ||||
pht( | pht( | ||||
'To configure Git to ignore certain files in this working copy, '. | 'To configure Git to ignore certain files in this working copy, '. | ||||
'add the file paths to "%s".', | 'add the file paths to "%s".', | ||||
'.git/info/exclude'), | '.git/info/exclude'), | ||||
); | ); | ||||
} | } | ||||
protected function saveStash() { | public function saveStash() { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
// NOTE: We'd prefer to "git stash create" here, because using "push" | // NOTE: We'd prefer to "git stash create" here, because using "push" | ||||
// and "pop" means we're affecting the stash list as a side effect. | // and "pop" means we're affecting the stash list as a side effect. | ||||
// However, under Git 2.21.1, "git stash create" exits with no output, | // However, under Git 2.21.1, "git stash create" exits with no output, | ||||
// no error, and no effect if the working copy contains only untracked | // no error, and no effect if the working copy contains only untracked | ||||
// files. For now, accept mutations to the stash list. | // files. For now, accept mutations to the stash list. | ||||
$api->execxLocal('stash push --include-untracked --'); | $api->execxLocal('stash push --include-untracked --'); | ||||
$log = $this->getWorkflow()->getLogEngine(); | $log = $this->getWorkflow()->getLogEngine(); | ||||
$log->writeStatus( | $log->writeStatus( | ||||
pht('SAVE STASH'), | pht('SAVE STASH'), | ||||
pht('Saved uncommitted changes from working copy.')); | pht('Saved uncommitted changes from working copy.')); | ||||
return true; | return true; | ||||
} | } | ||||
protected function restoreStash($stash_ref) { | public function restoreStash($stash_ref) { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
$log = $this->getWorkflow()->getLogEngine(); | $log = $this->getWorkflow()->getLogEngine(); | ||||
$log->writeStatus( | $log->writeStatus( | ||||
pht('LOAD STASH'), | pht('LOAD STASH'), | ||||
pht('Restoring uncommitted changes to working copy.')); | pht('Restoring uncommitted changes to working copy.')); | ||||
// NOTE: Under Git 2.21.1, "git stash apply" does not accept "--". | // NOTE: Under Git 2.21.1, "git stash apply" does not accept "--". | ||||
Show All 15 Lines |