Skip to content

EPMDEDP-17254: fix: Remove stray init master branch before pushing operator-authored repositories - #306

Merged
SergK merged 1 commit into
masterfrom
feature/EPMDEDP-17254-remove-stray-master
Aug 3, 2026
Merged

EPMDEDP-17254: fix: Remove stray init master branch before pushing operator-authored repositories#306
SergK merged 1 commit into
masterfrom
feature/EPMDEDP-17254-remove-stray-master

Conversation

@SergK

@SergK SergK commented Aug 3, 2026

Copy link
Copy Markdown
Member

go-git hardcodes the post-init HEAD to master, so every repository whose history the operator authors (create strategy squashes history, emptyProject inits from scratch) carried a leftover master ref next to the checked-out default branch, and the all-heads push refspec delivered it to the remote. Every provisioned repository with a non-master default branch silently received a spurious master branch, polluting branch protection, webhook triggers, and default-branch heuristics.

Remove the init branch after the default branch is checked out (HEAD is off master by then) and only for operator-authored histories: cloned repositories are never touched, since a branch of the same name there belongs to the source. Removal is idempotent on retries.

…erator-authored repositories

go-git hardcodes the post-init HEAD to master, so every repository whose history
the operator authors (create strategy squashes history, emptyProject inits from
scratch) carried a leftover master ref next to the checked-out default branch,
and the all-heads push refspec delivered it to the remote. Every provisioned
repository with a non-master default branch silently received a spurious master
branch, polluting branch protection, webhook triggers, and default-branch
heuristics.

Remove the init branch after the default branch is checked out (HEAD is off
master by then) and only for operator-authored histories: cloned repositories
are never touched, since a branch of the same name there belongs to the source.
Removal is idempotent on retries.

Signed-off-by: Sergiy Kulanov <sergiy_kulanov@epam.com>
@SergK
SergK requested a review from a team as a code owner August 3, 2026 20:01
@SergK
SergK merged commit a68a10f into master Aug 3, 2026
5 checks passed
@SergK
SergK deleted the feature/EPMDEDP-17254-remove-stray-master branch August 3, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant