git-ecosystem / git-bundle-server

A web server & management CLI to host Git bundles for use with Git's "bundle URIs" feature
Other
43 stars 20 forks source link

Perform atomic writes with `.lock` files #7

Open derrickstolee opened 2 years ago

derrickstolee commented 2 years ago

The git-bundle-web-server might be reading from a bundle list as it is being written by the git-bundle-server CLI. Avoid concurrency issues by using an equivalent to Git's .lock file mechanism:

  1. Write to <file>.lock.
  2. Rename <file>.lock to <file>.