Skip to content

createTwoFilesPatch and newlines - is this working as expected? #598

Description

@aliak00

Not sure if bug or using the api wrong, but trying to get the diff from these two:

Old text

One line
Two line
Other lines

New text with new line

One line
One.Five line
Two line
Other lines

Where new text has a new line at the end of the file, I get this patch diff:

Index: /Users/aliak/dev/quillia/apps/backend/test-app-data.local/README.md
===================================================================
--- /Users/aliak/dev/quillia/apps/backend/test-app-data.local/README.md original
+++ /Users/aliak/dev/quillia/apps/backend/test-app-data.local/README.md modified
@@ -1,3 +1,4 @@
 One line
+One.Five line
 Two line
\ No newline at end of file
-Other lines
+Other lines

The \ No newline at the end of file. Is that in the right place? How do I tell that a new line was added. If I do it the other way around - i.e. new line is in old text, and I remove it in new text then I get

--- /Users/aliak/dev/quillia/apps/backend/test-app-data.local/README.md original
+++ /Users/aliak/dev/quillia/apps/backend/test-app-data.local/README.md modified
@@ -1,3 +1,4 @@
 One line
+One.Five line
 Two line
-Other lines
+Other lines
\ No newline at end of file

Was \ No newline at end of file added or removed?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions