[go: up one dir, main page]

Skip to content

Browser copy-paste corrupts diff patches while curl works fine

Problem

If I go to the .diff url for an MR, manually copy all the text of the diff, then in the terminal pbpaste | git apply , I'll sometimes get a corrupt patch error. But if I curl [url of diff] | git apply for the same url, it works.

Steps to reproduce

The specific url where I just had this happen was !181052.diff

  1. go to !181052.diff in the browser
  2. select all and copy
  3. go to the GDK's gitlab subrepo directory, pbpaste | git apply
  4. get a corrupt patch error
  5. instead, in the same directory, run curl !181052.diff | git apply
  6. that works

181052.diff.txt

Initial troubleshooting

Removing this part of the diff worked fine

diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index b5e92f5fb203fdce4fe8e9b6e3b3d5e95d2bc488..d306730a3448d31a91c76e8813d0760ab39f54c1 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -38820,6 +38820,11 @@ msgstr ""
 msgid "Mark to-do item as done"
 msgstr ""
 
+msgid "Mark to-do item done"
+msgid_plural "Mark to-do items done"
+msgstr[0] ""
+msgstr[1] ""
+
 msgid "Markdown Help"
 msgstr ""
 
@@ -72949,9 +72954,6 @@ msgstr ""
 msgid "WorkItem|Make default for %{defaultState} issues"
 msgstr ""
 
-msgid "WorkItem|Mark as done"
-msgstr ""
-
 msgid "WorkItem|Mark this item as related to: %{workItemType} %{workItemReference}"
 msgstr ""
Edited by 🤖 GitLab Bot 🤖