Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: entered unreachable code: every line in hunk has one of '+', '-', or ' ' inserted after parsing #62

Closed
1 task done
Piturnah opened this issue Aug 30, 2023 · 2 comments
Labels
bug Something isn't working P:High High priority
Milestone

Comments

@Piturnah
Copy link
Owner

Is there an existing issue for this?

  • I have searched the existing issues

Description

Attempted to render the following diff in piturnah.xyz

diff --git a/asteroid-loop/index.html b/asteroid-loop/index.html
index d79df71..e2d1e9f 100644
--- a/asteroid-loop/index.html
+++ b/asteroid-loop/index.html
@@ -14,15 +14,10 @@
     var unityInstance = UnityLoader.instantiate("unityContainer", "Build/thing build.json", { onProgress: UnityProgress });
   </script>
   <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
-  <script>
-    $(function () {
-      $("#header").load("/assets/header.html");
-    });
-  </script>
 </head>
 
 <body>
-  <div id="header"></div>
+  <#header />
   <div class="webgl-content">
     <div id="unityContainer" style="width: 960px; height: 540px"></div>
     <div class="footer">
@@ -32,4 +27,4 @@
   </div>
 </body>
 
-</html>
\ No newline at end of file
+</html>

Expected Behavior

The diff should've been plainly rendered

Steps To Reproduce

No response

Environment

- OS: NixOS 23.05
- gex 0.6.3-dev (c7d36cf 2023-08-30 14:52:11 +0100)

Anything else?

Backtrace:

thread 'main' panicked at 'internal error: entered unreachable code: every line in hunk has one of '+', '-', or ' ' inserted after parsing', src/status.rs:97:26
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
   2: <&T as core::fmt::Display>::fmt
   3: core::fmt::rt::Argument::fmt
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/rt.rs:138:9
   4: core::fmt::write
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/mod.rs:1094:21
   5: <gex::status::Status as gex::render::renderer::Render>::render
   6: gex::main
@Piturnah Piturnah added bug Something isn't working P:High High priority labels Aug 30, 2023
@Piturnah Piturnah added this to the 0.6.3 milestone Aug 30, 2023
@Piturnah
Copy link
Owner Author

Might have something to do with trailing newline

@Piturnah
Copy link
Owner Author

Piturnah commented Aug 30, 2023

Also: this is the kind of thing I mean by #52

Piturnah added a commit that referenced this issue Aug 30, 2023
In the case of a newline inserted at the end of the file, git gives a
diff line leading with the previously unexpected '\' char.

NOTE: I think the assertion of characters being inserted was plainly
mistaken. Note to self to more strongly verify these assertions in
future.

fix #62
Piturnah added a commit that referenced this issue Aug 30, 2023
In the case of a newline inserted at the end of the file, git gives a
diff line leading with the previously unexpected '\' char.

NOTE: I think the assertion of characters being inserted was plainly
mistaken. Note to self to more strongly verify these assertions in
future.

fix #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P:High High priority
Projects
None yet
Development

No branches or pull requests

1 participant