Skip to content

Commit c9b7acc

Browse files
author
Prasetyo Wibowo
committed
Fix: correct the order of fetch and branch. Fetch should be executed first before branch.
1 parent d2c6d80 commit c9b7acc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

deploy.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,17 @@ function cmd($command, $print = true) {
231231
} else {
232232
// GIT_DIR exists and hopefully already contains the correct remote origin
233233
// so we'll fetch the changes
234-
// Checkout branch
235-
echo "\nCheckout branch $branch\n";
234+
echo "\nFetching repository from origin\n";
236235
cmd(sprintf(
237-
'git --git-dir="%s.git" --work-tree="%s" checkout %s'
236+
'git --git-dir="%s.git" --work-tree="%s" fetch --tags origin %s'
238237
, GIT_DIR
239238
, GIT_DIR
240239
, $branch
241240
));
242-
echo "\nFetching repository from origin\n";
241+
// Checkout branch
242+
echo "\nCheckout branch $branch\n";
243243
cmd(sprintf(
244-
'git --git-dir="%s.git" --work-tree="%s" fetch --tags origin %s'
244+
'git --git-dir="%s.git" --work-tree="%s" checkout %s'
245245
, GIT_DIR
246246
, GIT_DIR
247247
, $branch

0 commit comments

Comments
 (0)