sageserpent-open / kineticMerge

Merge a heavily refactored codebase and stay sane.
MIT License
12 stars 2 forks source link

Files modified in a subdirectory of the Git repository in their branch can't be merged. #18

Closed sageserpent-open closed 1 year ago

sageserpent-open commented 1 year ago

This is a regression introduced during the cutover to using os-lib done as part of #17.

The offending line of code is here. It should have been cutover consistently with the other two cases handling added and deleted files, using os-lib's RelPath to correctly handle a changed file path that has a directory prefix.

The fix is easy, but I'm concerned as to why this got through testing via MainTest. Clearly the latter needs to be more assiduous, there is some checking of files nested in subdirectories of the toy Git repository spun up by the tests; this needs to be bolstered.

Let's get the tests to reproduce this bug prior to fixing it.

sageserpent-open commented 1 year ago

MainTest has itself been cut over to use os-lib; it was simply too painful to carry on using the IO/NIO stack where relative paths themselves had directory prefixes that needed creating. A lot of cut-and-pasted code has been de-duplicated into the bargain, too.

sageserpent-open commented 1 year ago

Fixed in Git commit SHA: e17c75dbb9f4b0ca53aeebb86671ad97cf7653c4.

As it turned out, there was also a bug in one of the other two cases, the one for deletion that was detected by the upgraded tests.

It pays to be diligent.