The generated state URL contains backslashes on windows due to filepath.Clean being applied on the state parameter. An example would be:
[terraform-backend-git]: Locking state in https://github.com/Hathoute/terraform-states?ref=main//common\v1\state.json
[terraform-backend-git]: command error on refs/heads/locks/common\v1\state.json: funny refname
A fix would be to probably drop the Clean method since it doesn't do much anyway (we have to provide the full path to the state file).
Hey @Hathoute - thank you for interest in this project. You are right, looks like I incorrectly used filepath instead of path for sanitizing user input. I just pushed the fix - will build a release shortly.
The generated state URL contains backslashes on windows due to
filepath.Clean
being applied on the state parameter. An example would be:A fix would be to probably drop the Clean method since it doesn't do much anyway (we have to provide the full path to the state file).