Skip to content

Commit 313662c

Browse files
committed
Use fetch, not pull, to update bare repos
Pull expects a working directory (because it does a fetch, then a merge), so we should actually just use fetch. Specifying `origin master:master` also ensures our local master’s HEAD is updated to match origin master, and `--tags` ensures (hopefully) that we update all the local tags, too.
1 parent 15705f8 commit 313662c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/default/source-mirror.sh.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
local_dir=<%= node.source_mirror.data_dir %>/<%= repo_owner %>/<%= repo %>.git
77
if [ -d $local_dir ] ; then
88
cd $local_dir
9-
git pull
9+
git fetch --tags origin master:master
1010
cd -
1111
else
1212
mkdir -p `dirname $local_dir`
@@ -17,4 +17,4 @@ else
1717
cd -
1818
fi
1919
<% end %>
20-
<% end %>
20+
<% end %>

0 commit comments

Comments
 (0)