facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
6.18k stars 284 forks source link

`sl init` can wipe the entire directory #923

Open uhthomas opened 4 months ago

uhthomas commented 4 months ago

I just ran sl init and it deleted all the files in the directory :|

richjames0 commented 4 months ago

I have also run into this, specifically when running init twice. It says it aborts on the second time but it actually rm -rs which is very sad indeed.

(default) hcir@Richards-Mini / % cd ~
(default) hcir@Richards-Mini ~ % mkdir sapling test
(default) hcir@Richards-Mini ~ % echo . > test_file
(default) hcir@Richards-Mini ~ % mv test_file test/
(default) hcir@Richards-Mini ~ % cd test
(default) hcir@Richards-Mini test % ls
test_file
(default) hcir@Richards-Mini test % sl init --git
(default) hcir@Richards-Mini test % ls
test_file
(default) hcir@Richards-Mini test % sl init --git
abort: repository `/Users/hcir/test` already exists
(default) hcir@Richards-Mini test % ls
(default) hcir@Richards-Mini test %