{"version":"2.1.326","anchor":"git-upstream-check-hardened-against-option-like-branch-names","canonical_anchor":"git-upstream-check-hardened-against-option-like-branch-names","heading":"Safer check of whether a git branch tracks a remote branch","tier":"notice","area":"Git","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326\/e\/git-upstream-check-hardened-against-option-like-branch-names","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326","markdown":"### Safer check of whether a git branch tracks a remote branch\n\nClaude Code's check for a branch's upstream now rejects names starting with \"-\" and confirms the current position is a real local branch\n\n**What**\n\nIn git, a branch's upstream is the remote branch it tracks. When Claude Code checks for one, it now:\n\n- treats a name starting with `-` as having no upstream, because git could read such a name as an option;\n\n- confirms the current position (`HEAD`) points at a local branch under `refs\/heads\/`.\n\nBefore, it only checked that the git command succeeded and returned something.\n\n**Why**\n\nA branch name that looks like a command option can no longer be passed to git as one, which closes a way to inject arguments and avoids wrong answers.\n\n- Area: Git\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}