Browse Source

Merge #210: Do not fetch remote when it already there

355cd7e Fix incorrect gramma in RELEASE_NOTES (Putta Khunchalee)
4b886a9 Update RELEASE_NOTES (Putta Khunchalee)
0417729 Do not fetch remote when it already there (Putta Khunchalee)
pull/218/head
Devrandom 1 year ago
parent
commit
93a62c7d7d
No account linked to committer's email address
2 changed files with 10 additions and 5 deletions
  1. 5
    0
      RELEASE_NOTES
  2. 5
    5
      bin/gbuild

+ 5
- 0
RELEASE_NOTES View File

@@ -1,3 +1,8 @@
2019-05-13
----------

- No longer fetch repository from remote when the directory already exists

2017-02-14
----------


+ 5
- 5
bin/gbuild View File

@@ -285,15 +285,15 @@ build_desc["remotes"].each do |remote|
remote["url"] = urls[remote["dir"]]
end
dir = sanitize(remote["dir"], remote["dir"])
commit = sanitize(remote["commit"], remote["commit"])
unless File.exist?("inputs/#{dir}")
system!("git init inputs/#{dir}")
system!("git init inputs/#{dir}")
system!("cd inputs/#{dir} && git fetch --update-head-ok #{sanitize_path(remote["url"], remote["url"])} +refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/*")
system!("cd inputs/#{dir} && git checkout -q #{commit}")
system!("cd inputs/#{dir} && git submodule update --init --recursive --force")
end
system!("cd inputs/#{dir} && git fetch --update-head-ok #{sanitize_path(remote["url"], remote["url"])} +refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/*")
commit = sanitize(remote["commit"], remote["commit"])
commit = `cd inputs/#{dir} && git log --format=%H -1 #{commit}`.strip
raise "error looking up commit for tag #{remote["commit"]}" unless $?.exitstatus == 0
system!("cd inputs/#{dir} && git checkout -q #{commit}")
system!("cd inputs/#{dir} && git submodule update --init --recursive --force")
in_sums << "git:#{commit} #{dir}"
end


Loading…
Cancel
Save