mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:23:40 -05:00
Merge pull request #9973 from overleaf/em-duplicate-filenames-conflict
Fix the automatic fixing of duplicate filenames GitOrigin-RevId: 8ecdeb22c0c7f3c28983d4bf0f50c573193703b4
This commit is contained in:
parent
4af5ed24ad
commit
00b051e2d7
1 changed files with 20 additions and 0 deletions
|
@ -1522,6 +1522,26 @@ const ProjectEntityUpdateHandler = {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid conflicts by processing renames in the reverse order. If we have
|
||||||
|
// the following starting situation:
|
||||||
|
//
|
||||||
|
// somefile.tex
|
||||||
|
// somefile.tex
|
||||||
|
// somefile.tex (1)
|
||||||
|
//
|
||||||
|
// somefile.tex would be processed first, and then somefile.tex (1),
|
||||||
|
// yielding the following renames:
|
||||||
|
//
|
||||||
|
// somefile.tex -> somefile.tex (1)
|
||||||
|
// somefile.tex (1) -> somefile.tex (2)
|
||||||
|
//
|
||||||
|
// When the first rename was decided, we didn't know that somefile.tex (1)
|
||||||
|
// existed, so that created a conflict. By processing renames in the
|
||||||
|
// reverse order, we start with the files that had the most extensive
|
||||||
|
// information about existing files.
|
||||||
|
renames.reverse()
|
||||||
|
|
||||||
async.eachSeries(renames, doRename, callback)
|
async.eachSeries(renames, doRename, callback)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue