Use lstat instead of stat when calculating mtime #41

Merged
merged 1 commit into from Jun 27, 2012

5 participants

@ebroder

Prevents an exception when getting the mtime of a broken symlink.

@travisbot

This pull request passes (merged 78e0f2d4 into 7a2b49e).

@thibaudgg
Guard member

@Maher4Ever sounds good to you?

@rymai
Guard member

Could it be possible to add a spec with a non-broken symlink and a broken symlink?

@Maher4Ever
Guard member

Thanks for the patch. It does work, but I would also appreciate it if you could add some specs as @rymai suggested.

@ebroder

Ok. I've added a few specs that document the current behavior, although I don't entirely have a good understanding of whether the current behavior is desired.

In particular, it seems to handle broken symlinks somewhat inconsistently - for example, changing the target of a broken symlink (while leaving it broken) is picked up as removing the symlink. I think this is sufficient for my current use case (my primary interest is that it does not crash), but it seems like there's potentially room for improvement.

@travisbot

This pull request fails (merged 27e11932 into 7a2b49e).

@travisbot

This pull request fails (merged f4810948 into 7a2b49e).

@rymai
Guard member

Thanks @ebroder for the specs, could you rebase your branch on current master (and possibly squash all the commits into a single one)?

@Maher4Ever what do you think about the behavior for broken symlinks?

@ebroder ebroder Use lstat instead of stat when calculating mtime
Prevents an exception when getting the mtime of a broken symlink.
9bc5136
@travisbot

This pull request fails (merged 9bc5136 into 795bbce).

@thibaudgg thibaudgg merged commit ddb3ee5 into guard:master Jun 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment