You will need to make a second working copy; Keep in mind that your next implementation function may not be a new branch, but instead uses an existing branch or a branch based on another branch (something that means that you will check the code that returns your last function implementation during a test run )
You can make a script to handle all of this - you may finish the development of the current function, and then run the "buildandtesteverything {featurebranchname}" script. the script will move to the directory containing the root of your git repository, clone the repository into a temporary folder (checking the named branch), and then run your tests and clear it after itself.
source share