Title: AheadBehindTest relies on defaultBranch=master in .gitconfig · Issue #653 · git-commit-id/git-commit-id-maven-plugin · GitHub
Open Graph Title: AheadBehindTest relies on defaultBranch=master in .gitconfig · Issue #653 · git-commit-id/git-commit-id-maven-plugin
X Title: AheadBehindTest relies on defaultBranch=master in .gitconfig · Issue #653 · git-commit-id/git-commit-id-maven-plugin
Description: Describe the bug (required) The AheadBehindTest fails if defaultBranch is not equal to master in .gitconfig. Tell us about your plugin configuration (required) Not applicable Tell us about the Plugin version used (required) Master branch...
Open Graph Description: Describe the bug (required) The AheadBehindTest fails if defaultBranch is not equal to master in .gitconfig. Tell us about your plugin configuration (required) Not applicable Tell us about the Plug...
X Description: Describe the bug (required) The AheadBehindTest fails if defaultBranch is not equal to master in .gitconfig. Tell us about your plugin configuration (required) Not applicable Tell us about the Plug...
Opengraph URL: https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/653
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AheadBehindTest relies on defaultBranch=master in .gitconfig","articleBody":"### Describe the bug (required)\r\n\r\nThe `AheadBehindTest` fails if `defaultBranch` is not equal to `master` in `.gitconfig`.\r\n\r\n### Tell us about your plugin configuration (required)\r\n\r\nNot applicable\r\n\r\n### Tell us about the Plugin version used (required)\r\n\r\nMaster branch\r\n\r\n### Tell us about the Maven version used (required)\r\n\r\nNot applicable\r\n\r\n### Steps to Reproduce (required)\r\n\r\nChange all references to master to test in `AheadBehindTest`. See https://github.com/jkylling/git-commit-id-maven-plugin/commit/32de0ed4d877359546837e2c0925a99fc22d9b4e\r\n\r\n### Are there any stacktraces or any error messages? (required)\r\n\r\n```\r\norg.eclipse.jgit.api.errors.TransportException: Remote branch 'master' not found in upstream origin\r\n\r\n\tat org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)\r\n\tat org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:325)\r\n\tat org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:191)\r\n\tat pl.project13.maven.git.AheadBehindTest.setupSecondLocalRepository(AheadBehindTest.java:156)\r\n\tat pl.project13.maven.git.AheadBehindTest.setup(AheadBehindTest.java:61)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\r\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:568)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)\r\n\tat org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)\r\n\tat org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)\r\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)\r\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)\r\n\tat org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)\r\n\tat org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)\r\n\tat org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)\r\n\tat org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)\r\n\tat org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:413)\r\n\tat org.junit.runner.JUnitCore.run(JUnitCore.java:137)\r\n\tat com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)\r\n\tat com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)\r\n\tat com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)\r\n\tat com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)\r\n\tat com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)\r\n\tat com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)\r\nCaused by: org.eclipse.jgit.errors.TransportException: Remote branch 'master' not found in upstream origin\r\n\tat org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:157)\r\n\tat org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)\r\n\tat org.eclipse.jgit.transport.Transport.fetch(Transport.java:1462)\r\n\tat org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)\r\n\t... 36 more\r\n\r\n```\r\n### Is there a (public) project where this issue can be reproduced? (optional)\r\n\r\n_No response_\r\n\r\n### Your Environment (optional)\r\n\r\n_No response_\r\n\r\n### Context (optional)\r\n\r\nThe cause seems to be within jgit which does not set the `initialBranch` when initializing a repository when cloning. A workaround is to modify `.gitconfig` `defaultBranch`, or change `master` in the test to the value of `defaultBranch`. There is probably a way to fix the test to not rely on the value of `initialBranch`.","author":{"url":"https://github.com/jkylling","@type":"Person","name":"jkylling"},"datePublished":"2023-10-01T22:12:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/653/git-commit-id-maven-plugin/issues/653"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2c1f9181-9d54-d113-089c-c7fc8ad3f95e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC16:18CA1:34F129:426806:69906BF6 |
| html-safe-nonce | 8d0ffcd710e61e8f3a583e39b8f17fa5947f24ec1aca8191c39bf8d1d62c8b34 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzE2OjE4Q0ExOjM0RjEyOTo0MjY4MDY6Njk5MDZCRjYiLCJ2aXNpdG9yX2lkIjoiMjQ3ODQ3NzI0MTQ2NzU2Mjk5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a2b1fcebf02540f353e837506f452e70079dfcdf6270e077aea093149813fa42 |
| hovercard-subject-tag | issue:1921000312 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/git-commit-id/git-commit-id-maven-plugin/653/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f638b21f7461fcb69d46081505ae00e819705b1896bb267797e82f8df60b9aea/git-commit-id/git-commit-id-maven-plugin/issues/653 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f638b21f7461fcb69d46081505ae00e819705b1896bb267797e82f8df60b9aea/git-commit-id/git-commit-id-maven-plugin/issues/653 |
| og:image:alt | Describe the bug (required) The AheadBehindTest fails if defaultBranch is not equal to master in .gitconfig. Tell us about your plugin configuration (required) Not applicable Tell us about the Plug... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jkylling |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/git-commit-id/git-commit-id-maven-plugin git https://github.com/git-commit-id/git-commit-id-maven-plugin.git |
| octolytics-dimension-user_id | 43124426 |
| octolytics-dimension-user_login | git-commit-id |
| octolytics-dimension-repository_id | 1361792 |
| octolytics-dimension-repository_nwo | git-commit-id/git-commit-id-maven-plugin |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1361792 |
| octolytics-dimension-repository_network_root_nwo | git-commit-id/git-commit-id-maven-plugin |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width