Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / g / git-sync.rb
blob1b286bc01d9be511de4fb76488ffdb799557993a
1 class GitSync < Formula
2   desc "Clones a git repository and keeps it synchronized with the upstream"
3   homepage "https://github.com/kubernetes/git-sync"
4   url "https://github.com/kubernetes/git-sync/archive/refs/tags/v4.4.0.tar.gz"
5   sha256 "0961f09e3c370f68bd10d6de4c44673ddd7b4adc602d38a7e67d22ae7fe6ae2e"
6   license "Apache-2.0"
7   head "https://github.com/kubernetes/git-sync.git", branch: "master"
9   bottle do
10     sha256 cellar: :any_skip_relocation, arm64_sequoia: "f519dd5d3f4e17d08cd18df54321f4b1927dbf5b8796414817bbfb4bb957e623"
11     sha256 cellar: :any_skip_relocation, arm64_sonoma:  "f519dd5d3f4e17d08cd18df54321f4b1927dbf5b8796414817bbfb4bb957e623"
12     sha256 cellar: :any_skip_relocation, arm64_ventura: "f519dd5d3f4e17d08cd18df54321f4b1927dbf5b8796414817bbfb4bb957e623"
13     sha256 cellar: :any_skip_relocation, sonoma:        "ba49e1392eac821ae7281be0ed6ac349846aad756c9c6d411f4d9401cea094bf"
14     sha256 cellar: :any_skip_relocation, ventura:       "ba49e1392eac821ae7281be0ed6ac349846aad756c9c6d411f4d9401cea094bf"
15     sha256 cellar: :any_skip_relocation, x86_64_linux:  "4586a92451531c814868c94f92e2d5097f9171036d60e70769005b3dceee3ca5"
16   end
18   depends_on "go" => :build
20   depends_on "coreutils"
22   conflicts_with "git-extras", because: "both install `git-sync` binaries"
24   def install
25     ldflags = %W[
26       -s -w
27       -X k8s.io/git-sync/pkg/version.VERSION=v#{version}
28     ]
29     system "go", "build", *std_go_args(ldflags:)
30   end
32   test do
33     expected_output = "Could not read from remote repository"
34     assert_match expected_output, shell_output("#{bin}/#{name} --repo=127.0.0.1/x --root=/tmp/x 2>&1", 1)
36     assert_match version.to_s, shell_output("#{bin}/#{name} --version")
37   end
38 end