1 class GitDeleteMergedBranches < Formula
2 include Language::Python::Virtualenv
4 desc "Command-line tool to delete merged Git branches"
5 homepage "https://github.com/hartwork/git-delete-merged-branches"
6 url "https://files.pythonhosted.org/packages/dc/e5/c76a87598f2c76574e6741abedbda6bd50e709f8b51a3d0a30bb130a8dce/git_delete_merged_branches-7.4.2.tar.gz"
7 sha256 "44a4ae5a83f194f0800e373519fd22c6bb3e6e99b883221f7b666bd36cdac415"
8 license "GPL-3.0-or-later"
11 sha256 cellar: :any_skip_relocation, all: "4681c0148a8b4bf480fc79f0f6ba3b89ebe0ba936f9a3d165f2099422684a5a1"
14 depends_on "python@3.13"
16 conflicts_with "git-extras", because: "both install `git-delete-merged-branches` binaries"
18 resource "colorama" do
19 url "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz"
20 sha256 "08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"
23 resource "prompt-toolkit" do
24 url "https://files.pythonhosted.org/packages/2d/4f/feb5e137aff82f7c7f3248267b97451da3644f6cdc218edfe549fb354127/prompt_toolkit-3.0.48.tar.gz"
25 sha256 "d6623ab0477a80df74e646bdbc93621143f5caf104206aa29294d53de1a03d90"
29 url "https://files.pythonhosted.org/packages/6c/63/53559446a878410fc5a5974feb13d31d78d752eb18aeba59c7fef1af7598/wcwidth-0.2.13.tar.gz"
30 sha256 "72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"
34 virtualenv_install_with_resources
38 origin = testpath/"origin"
40 clone = testpath/"clone"
43 system "git", "config", "--global", "init.defaultBranch", "master"
45 system "git", "config", "user.name", "BrewTestBot"
46 system "git", "config", "user.email", "BrewTestBot@example.com"
47 system "git", "commit", "--allow-empty", "-m", "Initial commit"
50 system "git", "clone", origin, clone
53 system "git", "config", "remote.origin.dmb-enabled", "true"
54 system "git", "config", "branch.master.dmb-required", "true"
55 system "git", "config", "delete-merged-branches.configured", "5.0.0+"
56 system "git", "checkout", "-b", "new-branch"
57 system "git", "checkout", "-"
58 system "git", "delete-merged-branches", "--yes"
59 branches = shell_output("git branch").split("\n")
60 assert_equal 1, branches.length