rust/rhg/src/commands/root.rs
changeset 46167 8a4914397d02
parent 46135 dca9cb99971c
child 46484 a6e4e4650bac
--- a/rust/rhg/src/commands/root.rs	Sat Dec 19 15:56:54 2020 +0100
+++ b/rust/rhg/src/commands/root.rs	Mon Dec 14 16:33:15 2020 +0100
@@ -2,7 +2,7 @@
 use crate::error::CommandError;
 use crate::ui::Ui;
 use format_bytes::format_bytes;
-use hg::operations::find_root;
+use hg::repo::Repo;
 use hg::utils::files::get_bytes_from_path;
 
 pub const HELP_TEXT: &str = "
@@ -21,12 +21,9 @@
 
 impl Command for RootCommand {
     fn run(&self, ui: &Ui) -> Result<(), CommandError> {
-        let path_buf = find_root()?;
-
-        let bytes = get_bytes_from_path(path_buf);
-
+        let repo = Repo::find()?;
+        let bytes = get_bytes_from_path(repo.working_directory_path());
         ui.write_stdout(&format_bytes!(b"{}\n", bytes.as_slice()))?;
-
         Ok(())
     }
 }