Farid Zakaria reports that when no credential-cache daemon is running, two concurrent "git credential-cache store" commands each try to start one. unix_stream_listen() removes whatever is at the socket path before binding, so the second daemon takes over the first one's socket.
The first daemon keeps running, but no client can reach it. The credential its client stored is lost, and "git credential-cache get" does not return it. "git credential-cache exit" stops only the second daemon, so the first keeps the password in memory until it times out. When the first daemon finally exits, its tempfile handler removes the second daemon's socket, so that daemon's credentials are lost too.
Patch 1 creates the socket with unix_ss_create(), which the simple-ipc server already uses. According to the commit message it takes a lock and binds, which stops one daemon from replacing another's socket.
Patch 2 covers a second race. If the socket directory does not exist yet, both daemons try to create it, and the later one dies with "fatal: unable to mkdir '<home>/.cache/git/credential': File exists". The client then fails with "cache daemon did not start". The fix ignores EEXIST from mkdir() and checks the directory's permissions as it would for one that already existed.
No review comments appear in the excerpts.