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

revtool snap panics #9

Closed
pete-murphy opened this issue May 3, 2023 · 1 comment · Fixed by #10
Closed

revtool snap panics #9

pete-murphy opened this issue May 3, 2023 · 1 comment · Fixed by #10

Comments

@pete-murphy
Copy link
Contributor

pete-murphy commented May 3, 2023

Code/rust/foo
❯ revtool init

Code/rust/foo
❯ echo "💩" >> poo.txt

Code/rust/foo
❯ revtool changes
{
  "deleted": [],
  "added": {
    "poo.txt": {
      "File": "9c7ecb3d4acb554df052dbaf031d51987a0ba8970dd858d157bb40aabf9ce948"
    }
  },
  "modified": {}

Code/rust/foo
❯ revtool snap --message "Added poo.txt"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("expected value", line: 1, column: 1)', app/main.rs:53:77
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I think

let branch: String = read_json(&rev_dir.join("branch"));
might need to use the same read_to_string as the Changes branch

version-control/app/main.rs

Lines 130 to 136 in 19b9675

let branch: String = read_to_string(
File::options()
.read(true)
.open(&rev_dir.join("branch"))
.unwrap(),
)
.unwrap(); // read_json(&rev_dir.join("branch"));

I can make that change if that sounds right?

@SamuelSchlesinger
Copy link
Owner

That is right indeed, thanks for catching it. #1 should naturally fix this kind of inconsistency, gotta get to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants