fix(git): handle file renames between folders (#6020)
* git storage: handle file renames between folders --------- Co-authored-by: Nicolas Giard <github@ngpixel.com>
This commit is contained in:
		| @@ -725,7 +725,7 @@ module.exports = class Page extends Model { | ||||
|     const destinationHash = pageHelper.generateHash({ path: opts.destinationPath, locale: opts.destinationLocale, privateNS: opts.isPrivate ? 'TODO' : '' }) | ||||
|  | ||||
|     // -> Move page | ||||
|     const destinationTitle = (page.title === page.path ? opts.destinationPath : page.title) | ||||
|     const destinationTitle = (page.title === _.last(page.path.split('/')) ? _.last(opts.destinationPath.split('/')) : page.title) | ||||
|     await WIKI.models.pages.query().patch({ | ||||
|       path: opts.destinationPath, | ||||
|       localeCode: opts.destinationLocale, | ||||
| @@ -745,6 +745,7 @@ module.exports = class Page extends Model { | ||||
|       ...page, | ||||
|       destinationPath: opts.destinationPath, | ||||
|       destinationLocaleCode: opts.destinationLocale, | ||||
|       title: destinationTitle, | ||||
|       destinationHash | ||||
|     }) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user