pijul_org / pijul

#215 pijul patch gives: thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:20

Opened by laumann, on October 20, 2017
pijul-0.9
Bug
Closed
laumann commented on October 20, 2017

In pijul's project, run:

% pijul patch 8BCdYoFNy8yzudGMCZRNmxvYBDryqqbME1VLPZbJ6R82Q6VDymV4UKKwwcMFkHroV9j2Gw2fZVgsUL7LoJuJC1Es
After line 119:
-                   Inode, ROOT_INODE, ROOT_KEY, SmallString, SmallStr, ApplyTimestamp};
In "["libpijul", "src", "lib.rs"]":
From line 119:
+                   Inode, ROOT_INODE, ROOT_KEY, SmallString, SmallStr, ApplyTimestamp,
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:20
note: Run with `RUST_BACKTRACE=1` for a backtrace.

I'll run a debug build to get a better stacktrace.

laumann commented on October 20, 2017

So the unwrap() error was in commands/patch.rs:

let (_, line_num) = *(buf.numbers.get(&key)).unwrap();

If I'm guessing correctly, the assumption was that every line (or node) had a line number, which appears not always to be the case. Changing it to default to current + 1 seems to fix it and give the expected output.

lthms commented on October 20, 2017

As far as I can tell, the patch fixes the panic error.

lthms added tag
Bug
on October 20, 2017
laumann commented on October 30, 2017

@pmeunier Can you confirm that this is the right fix? I get the same error on the current master

pmeunier commented on October 30, 2017

I don't think this is actually the right fix, the same issue happened on the Nest too, and the problem was that the branch was incorrect.

I'll come back to this issue very soon.

lthms commented on November 28, 2017

What’s the status of this issue? I think I can still reproduce with the current upstream.

laumann commented on November 28, 2017

I don't think a fix was ever introduced.

lthms closed this discussion on April 28, 2018