Use lstat instead of stat when calculating mtime #41

Merged
merged 1 commit into from Jun 27, 2012

Conversation

Projects
None yet
6 participants
Contributor

ebroder commented Jun 14, 2012

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

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

Owner

thibaudgg commented Jun 15, 2012

@Maher4Ever sounds good to you?

Owner

rymai commented Jun 15, 2012

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

Contributor

Maher4Ever commented Jun 15, 2012

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

Contributor

ebroder commented Jun 17, 2012

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.

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

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

Owner

rymai commented Jun 20, 2012

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?

Use lstat instead of stat when calculating mtime
Prevents an exception when getting the mtime of a broken symlink.

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

thibaudgg added a commit that referenced this pull request Jun 27, 2012

Merge pull request #41 from ebroder/broken-symlinks
Use lstat instead of stat when calculating mtime

@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