vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Merge change request 01M70WES5ZZDJ6RP226WB11BBZ: Let people rename and remove their own passkeys
keenan · 27m ago
4b8c9e1d
| 1 | //go:build !unix |
| 2 | |
| 3 | package git |
| 4 | |
| 5 | import ( |
| 6 | "os" |
| 7 | "sync" |
| 8 | ) |
| 9 | |
| 10 | // flock is not part of the portable API, so a platform without it serializes |
| 11 | // writers inside one process only. That still removes the retry storm between |
| 12 | // requests handled by one server; a second process on the same repository falls |
| 13 | // back to the compare-and-swap, which is correct and slower. Vole ships packages |
| 14 | // for the platforms where the kernel lock is available; this keeps the rest |
| 15 | // building and says what it does. |
| 16 | var ( |
| 17 | processLocksMu sync.Mutex |
| 18 | processLocks = map[string]*sync.Mutex{} |
| 19 | ) |
| 20 | |
| 21 | func lockFile(f *os.File) (func(), error) { |
| 22 | processLocksMu.Lock() |
| 23 | mu := processLocks[f.Name()] |
| 24 | if mu == nil { |
| 25 | mu = &sync.Mutex{} |
| 26 | processLocks[f.Name()] = mu |
| 27 | } |
| 28 | processLocksMu.Unlock() |
| 29 | mu.Lock() |
| 30 | return mu.Unlock, nil |
| 31 | } |
| 32 |