Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TCE-1173] Version always bumped even when no commit matches log-path filter #100

Open
jackie-linz opened this issue Nov 20, 2024 · 1 comment
Labels
jira-issue Issue tracked on JIRA

Comments

@jackie-linz
Copy link

Test case

  it "should not bump version if no commit matches log-path filter" do
    tmp = InTmp.new

    begin
      git = GitVersion::Git.new("dev", "master", "feature:", "breaking:", tmp.@tmpdir, "dir1-", "dir1/")

      tmp.exec %(git init)
      tmp.exec %(git checkout -b master)

      # Create dir1 and tag dir1-1.0.0
      base_dir = "dir1"
      tmp.exec %(mkdir #{base_dir} && touch #{base_dir}/dummy_file)
      tmp.exec %(git add #{base_dir}/)
      tmp.exec %(git commit --no-gpg-sign -m "feature: 1")
      tmp.exec %(git tag "dir1-1.0.0")

      # Create dir2 and tag dir2-1.0.0
      base_dir = "dir2"
      tmp.exec %(mkdir #{base_dir} && touch #{base_dir}/dummy_file)
      tmp.exec %(git add #{base_dir}/)
      tmp.exec %(git commit --no-gpg-sign -m "feature: 2")
      tmp.exec %(git tag "dir2-1.0.0")

      # Commit feature in dir2
      base_dir = "dir2"
      tmp.exec %(mkdir -p #{base_dir} && touch #{base_dir}/dummy_file_2)
      tmp.exec %(git add #{base_dir}/)
      tmp.exec %(git commit --no-gpg-sign -m "feature: 3")

      # git-version should not bump version for dir1
      version = git.get_new_version
      hash = git.current_commit_hash
      version.should eq("dir1-1.0.0")
    ensure
      tmp.cleanup
    end
  end
@github-actions github-actions bot added the jira-issue Issue tracked on JIRA label Nov 20, 2024
@github-actions github-actions bot changed the title Version always bumped even when no commit matches log-path filter [TCE-1173] Version always bumped even when no commit matches log-path filter Nov 20, 2024
Copy link

github-actions bot commented Nov 20, 2024

Internal ticket created : TCE-1173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-issue Issue tracked on JIRA
Projects
None yet
Development

No branches or pull requests

1 participant