I have a JENKINS-40529 branch in my jenkins-bugs repository that contains a script that creates a new commit, tags the new commit with a unique tag name, and then deletes all other tag names locally and remotely which might have preceded that tag name.
That sequence of steps causes the remote repository to typically have only one tag for content on this branch. The preceding tags placed on that branch are deleted.
When I run a Freestyle project, I see that the tags accumulate in the workspace of the freestyle project as the job detects new changes and runs. That is the expected behavior without the "prune stale tags" extension.
When I add the "prune stale tags" extension on that job, I was expecting the tags to be removed from the workspace each time new changes are fetched into the repository. Unfortunately, with my docker image (using CLI git 2.17) and with several of my agents (one using CLI git 2.26), the stale tags are not removed from the workspace when new changes are fetched into the workspace. Refer to the config.xml file of my freestyle job for details.