summaryrefslogtreecommitdiffstats
path: root/git-precheck
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2026-03-06 15:08:05 -0500
committerMatt Hunter <m@lfurio.us>2026-03-16 04:36:28 -0400
commit8d429259e3fb9c22bc3a3935bc3d41417dadedf5 (patch)
tree1b938e9460d85d8bea8e325061ba801bc367329b /git-precheck
parent8f1e0156d4c47497453a234fe31ca299a259796b (diff)
downloadgit-sonar-8d429259e3fb9c22bc3a3935bc3d41417dadedf5.tar.gz
git-sonar-8d429259e3fb9c22bc3a3935bc3d41417dadedf5.zip
Refactor autofetch logic
Code for handling the auto background fetch is merged down to 1 function, and various changes are made to improve portability and POSIX compliance. The "lastupdatetime" file now stores the unix timestamp in its content, rather than the mtime timestamp. This will provide better platform cross-compatibility, and allows us to drop some code which trys to handle different styles of the stat command. Furthermore, the path to this file (or the .git directory) is no longer cached, since it only needs to be obtained by the script once in this spot. The `[ "$timestamp" -eq "$timestamp" ]` syntax is used to confirm that the content of the "lastupdatetime" file is an integer. This will fail on first encounter with a repository, or if migrating from the old timestamp-based format, or if the file was just mucked with, in which case $timestamp is forced to 0, and a fetch will very likely just occur on the spot. This will fixup the file by writing a new timestamp out to it. Signed-off-by: Matt Hunter <m@lfurio.us>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions