summaryrefslogtreecommitdiff
path: root/arm
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-01-26 07:53:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-01-30 05:48:57 (GMT)
commitbda3a31cc7982a7ef8ddb5137359d27c3c75ebed (patch)
tree513ecbeda8edf76f131ccca1cbe8296c3d694f95 /arm
parent7720224cebde08186627ab7bdb06018905d84e30 (diff)
downloadgit-bda3a31cc7982a7ef8ddb5137359d27c3c75ebed.zip
git-bda3a31cc7982a7ef8ddb5137359d27c3c75ebed.tar.gz
git-bda3a31cc7982a7ef8ddb5137359d27c3c75ebed.tar.bz2
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 'arm')
0 files changed, 0 insertions, 0 deletions