Subject: [PATCH] fetch: add fetch.pruneLocalBranches config

From: Harald Nordgren <[email-masked]>
Date: Mon, 11 May 2026 10:44:36 +0200

> Existing call sites are about "branch -d <other>" that allows the
> other branch to be deleted if it is part of HEAD or if it is part of
> its tracking branch, but should "branch --prune-merged" pay
> attention to what branch happens to be checked out the same way (not
> a rherotical question to hint that I do not think it should---I do
> not have a strong opinion on this either way)?

This is a very good question! My opion is that it should work the same way
regardless of which branch you are on, it should always compare against the
remote's default branch.

I this explains some weirdness I saw today when running it from non-main
and prune didn't get triggered.

I will look into making that change.

Harald