mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.84k stars 1.02k forks source link

Fix 1023494: Unsaved new documents have `/` added to begining of file name #9347

Closed DavidKarlas closed 4 years ago

DavidKarlas commented 4 years ago

I think that anything that needs Canonical comparison should make conversion itself. I'm also not aware of any regressions this might cause... @slluis any ideas?

Therzok commented 4 years ago

@davidkarlas maybe we could have a unit test with a file controller pointing to a symlinked file, and assert that the symlink is unchanged and we wrote to the real file.

DavidKarlas commented 4 years ago

@Therzok what is bug# of bug you are referring to?

Therzok commented 4 years ago

Can't find it, seems to be new code in the new document model. In any case, can we add that test? :D

DavidKarlas commented 4 years ago

Test for something this PR doesn't fix?

Therzok commented 4 years ago

Okay, for some reason, I thought CanonicalPath resolves symlinks, but it doesn't. LGTM

DavidKarlas commented 4 years ago

Added unit test for new behavior.

slluis commented 4 years ago

A better solution would be to only get the canonical path when the path is absolute.

DavidKarlas commented 4 years ago

@slluis updated code as suggested to do Canonical only for AbsolutePath.