Closed phil-davis closed 2 years ago
The normal
git diff
output gives a list of changed files:
This project doesn't use any "normal git". It's 100% based on github.com/go-git/go-git/v5
But what bugs me the most is the output of these pipelines (eg. https://drone.owncloud.com/owncloud/core/36297/36/3):
latest: Pulling from owncloudci/drone-skip-pipeline
Digest: sha256:7eb8fc9c9f92bc1457bd640a20cc14e3fe0f54178b7a3dd8b1f3e2cb07f49d83
Status: Image is up to date for owncloudci/drone-skip-pipeline:latest
DRONE_COMMIT_BEFORE: 46de3c5cf386ba5c99e3309bad12655dbb74c073
DRONE_COMMIT_AFTER: a1bdb4f87c09f4484b3a6be32ea18fbda65db5c7
### changed files ###
There are no files supposed to be changed... But if one diffs the two commits referenced, one will clearly see the changes.
There are no files supposed to be changed... But if one diffs the two commits referenced, one will clearly see the changes.
Hmmm - that's trickier. If github.com/go-git/go-git/v5
does not find changed files with "special names" then it's going to be difficult.
Maybe I should look upstream to see if it is easily fixed...
The normal
git diff
output gives a list of changed files:But if a file name has special characters then it is surrounded by double-quotes:
Examples are from
ownclud/core
I noticed this because the acceptance tests were all skipped in https://github.com/owncloud/core/pull/40200 even though a file in
tests/acceptance
had changed.The regex comparison is looking for files with paths starting with
tests/acceptance
but this starts with"tests/acceptance
This PR adds code to trim off the double-quotes at the end of any entries in the list of changed files. That will allow them to match the typical regexes that are used, that start with some "ordinary-named" path.
Note: if someone really wants to exactly match some path+file that has strange characters in the name, then they will still have to do some hard work to find the string that
git diff
produces and make sure that their regex will match it - but that is a different challenge.