I have a small Bash script which includes some Git commands. (For certain reasons, I cannot use git hooks here.)
Basically, it does
git pull origin <<some repo>> || { echo "Git pull FAILED"; exit 1; }
# do something with the new/changed files on the file system
In not reproducible cases, this fails. In these cases, old versions of the files (being at the state before git pull) are used instead of the new files (at the state after git pull).
However, if I manually do git pull and afterward run the other command, there was never any problem.
So, I'm now wondering if there is any delay/asynchronicity in Git changing the files on the file system after a pull. If yes: How can I deal with it (maybe avoiding sleep or something like that)? If not: What else could cause the confusion of file versions here?