Jeff King <peff@xxxxxxxx> writes: > I was mostly thinking of hacky scripts that tried to touch .git/refs > directly. And there are a few levels of dangerous there: > > - if you're doing "echo $sha1 >.git/refs/heads/master", then you're > not locking properly. But it would probably work most of the time. > > - if you're properly taking a lock on ".git/refs/heads/master.lock" > and renaming into place but not looking at packed-refs, then you > might overwrite somebody else's update which is in the packed file > > - if you're trying to read refs and not reading packed-refs, obviously > you might miss some values ... but the values you read are the right ones as loose refs overlay and trump what is in packed-refs. - if you're trying to delete a branch by removing a file under refs/, that would uncover the corresponding entry in packed-refs, if exists---in other words, you may resurrect an older value of a branch instead of deleting it.