Skip to content

Commit c69cfb9

Browse files
committed
Fetch only necessary commits of bundled gems
1 parent 75d63f3 commit c69cfb9

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

defs/gmake.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ $(srcdir)/.bundle/.timestamp:
365365
define build-gem
366366
$(srcdir)/gems/src/$(1)/.git: | $(srcdir)/gems/src
367367
$(ECHO) Cloning $(4)
368-
$(Q) $(GIT) clone $(4) $$(@D)
368+
$(Q) $(GIT) clone --depth=1 --no-tags $(4) $$(@D)
369369

370370
$(bundled-gem-revision): \
371371
$(if $(if $(wildcard $$(@)),$(filter $(3),$(shell cat $$(@)))),,PHONY) \

tool/fetch-bundled_gems.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@
3535
if r
3636
puts "fetching #{color.notice(r)} ..."
3737
system("git", "fetch", "origin", r, chdir: n) or abort
38+
c = r
39+
else
40+
c = ["v#{v}", v].find do |c|
41+
puts "fetching #{color.notice(c)} ..."
42+
system("git", "fetch", "origin", "refs/tags/#{c}:refs/tags/#{c}", chdir: n)
43+
end or abort
3844
end
3945

40-
c = r || "v#{v}"
4146
checkout = %w"git -c advice.detachedHead=false checkout"
4247
print %[checking out #{color.notice(c)} (v=#{color.info(v)}]
4348
print %[, r=#{color.info(r)}] if r

0 commit comments

Comments
 (0)