diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-01-25 23:53:05 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-01-29 21:48:57 -0800 |
commit | bda3a31cc7982a7ef8ddb5137359d27c3c75ebed (patch) | |
tree | 513ecbeda8edf76f131ccca1cbe8296c3d694f95 /hash.h | |
parent | gitweb: Convert generated contents to utf8 in commitdiff_plain (diff) | |
download | tgif-bda3a31cc7982a7ef8ddb5137359d27c3c75ebed.tar.xz |
reflog-expire: Avoid creating new files in a directory inside readdir(3) loop
"git reflog expire --all" opened a directory in $GIT_DIR/logs/,
read reflog files in there readdir(3), and rewrote the file by
creating a new file and renaming it back inside the loop. This
code structure can cause the newly created file to be returned
by subsequent call to readdir(3), and fall into an infinite loop
in the worst case.
This separates the processing to two phase. Running
for_each_reflog() to find out and collect all refs, and then
iterate over them, calling expire_reflog(). This way, the
program would behave exactly the same way as if all the refs
were given by the user from the command line.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'hash.h')
0 files changed, 0 insertions, 0 deletions