Ignore broken symlinks and outside path, in commit #142
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a bug in go-git which leads to it reporting broken, absolute
symlinks as modified whether they are or not:
To date, the controller checks whether the repo it has run an update
on is Clean, and as a consequence will run into the bug above if a
broken symlink is in the repo. The result is that it makes and pushes
an empty commit every interval.
To work around the problem, this commit adds a more careful check of
the repo status. Each file reported as modified is validated, firstly
by checking that it's under the path given; and secondly by checking
specifically that it's not a broken symlink.
For convenience, I have moved a few procedures around so they can be
used more readily by go tests.
Fixes #135.
Of this bit I am not convinced. It's possible you have a valid symlink under the path, targeting a file not under the path, and you want the update to work. It's also possible you've come to this arrangement by accident -- but I shouldn't presume so!
UPDATE: I removed the path limitation in another commit; it can be squashed in, or reset out.