pijul_org / pijul

#81 pijul add on empty dir panics

Opened by mark, on May 10, 2017
Closed
mark commented on May 10, 2017

running pijul add . in an empty dir panics

mark@WKS57962l ~/tmpfs $ pijul init test
mark@WKS57962l ~/tmpfs $ cd test
mark@WKS57962l ~/tmpfs/test $ pijul add .
    thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:323
    note: Run with `RUST_BACKTRACE=1` for a backtrace.

mark@WKS57962l ~/tmpfs/test $ ls -la
    total 0
    drwxrwxr-x. 3 mark mark  60 May 10 16:17 .
    drwxrwxrwt. 5 root root 100 May 10 16:17 ..
    drwxrwxr-x. 4 mark mark 120 May 10 16:17 .pijul
mark commented on May 10, 2017

infact, it panics even when the dir isn't empty

mark@WKS57962l ~/tmpfs $ pijul init fooo
mark@WKS57962l ~/tmpfs $ cd fooo/
mark@WKS57962l ~/tmpfs/fooo $ echo asdasd > test
mark@WKS57962l ~/tmpfs/fooo $ pijul add .
    thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:323
    note: Run with `RUST_BACKTRACE=1` for a backtrace.
pmeunier commented on May 10, 2017

Thanks for reporting, I just pushed #AWbdMZupin1ML54G6mycDsiMH3VariuTxMFnskjBV1c5tGjFPmkoVpynbzO4Q1KBazGGl-rfGOtBVMR05wi2EMo as a fix.

I really wonder though: what did you think this command would do? It is not very useful to start tracking the root of the the repository, only individual files and directories can be tracked. I'd be really interested by your answer, this looks like a documentation issue.

mark commented on June 9, 2017

In git that adds all the files. That's what I was thinking would happen.

Now that you've pointed it out, I don't know why I thought something from git would work in pijul, just habit I guess :)