1 | <?php |
||
30 | class StashCommand extends BaseCommand |
||
31 | { |
||
32 | const STASH_COMMAND = 'stash'; |
||
33 | |||
34 | /** |
||
35 | * constructor |
||
36 | * |
||
37 | * @param \GitElephant\Repository $repo The repository object this command |
||
38 | * will interact with |
||
39 | */ |
||
40 | public function __construct(Repository $repo = null) |
||
44 | |||
45 | /** |
||
46 | * Save your local modifications to a new stash, and run git reset --hard to revert them. |
||
47 | * |
||
48 | * @param string|null $message |
||
49 | * @param boolean $includeUntracked |
||
50 | * @param boolean $keepIndex |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | public function save($message = null, $includeUntracked = false, $keepIndex = false) |
||
72 | |||
73 | /** |
||
74 | * Shows stash list |
||
75 | * |
||
76 | * @param array|null $options |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function listStashes(array $options = null) |
||
89 | |||
90 | /** |
||
91 | * Shows details for a specific stash |
||
92 | * |
||
93 | * @param string $stash |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | public function show($stash) |
||
105 | |||
106 | /** |
||
107 | * Drops a stash |
||
108 | * |
||
109 | * @param string $stash |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | public function drop($stash) |
||
121 | |||
122 | /** |
||
123 | * Applies a stash |
||
124 | * |
||
125 | * @param string $stash |
||
126 | * @param boolean $index |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | public function apply($stash, $index = false) |
||
141 | |||
142 | /** |
||
143 | * Applies a stash, then removes it from the stash |
||
144 | * |
||
145 | * @param string $stash |
||
146 | * @param boolean $index |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | public function pop($stash, $index = false) |
||
161 | |||
162 | /** |
||
163 | * Creates and checks out a new branch named <branchname> starting from the commit at which the <stash> was originally created |
||
164 | * |
||
165 | * @param string $branch |
||
166 | * @param string $stash |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function branch($branch, $stash) |
||
179 | |||
180 | /** |
||
181 | * Remove all the stashed states. |
||
182 | * |
||
183 | */ |
||
184 | public function clear() |
||
190 | |||
191 | /** |
||
192 | * Create a stash (which is a regular commit object) and return its object name, without storing it anywhere in the |
||
193 | * ref namespace. |
||
194 | * |
||
195 | */ |
||
196 | public function create() |
||
202 | |||
203 | /** |
||
204 | * @param $stash |
||
205 | * |
||
206 | * @return string |
||
207 | */ |
||
208 | private function normalizeStashName($stash) |
||
215 | |||
216 | } |
||
217 |