refdb_fs.c
53.8 KB
-
git_reference_create_matching: Treat all-zero OID as "must be absent" · 95b7a639
This is pretty useful in avoiding races: I want to create a ref only if it doesn't already exist. I can't check first because of TOCTOU -- by the time I finish the check, someone else might have already created the ref. And I can't take a lock because then I can't do the create, since the create expects to take the lock. The semantics are inspired by git update-ref, which allows an all-zero old value to mean that the ref must not exist.
David Turner committed