Skip to content

Commit a3fc9a0

Browse files
authored
fix: force Git checkout for plugin cache repositories (#3169)
1 parent 4a3710b commit a3fc9a0

File tree

8 files changed

+196
-5
lines changed

8 files changed

+196
-5
lines changed

yazi-cli/src/package/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl Git {
1616
}
1717

1818
pub(super) async fn checkout(path: &Path, rev: &str) -> Result<()> {
19-
Self::exec(|c| c.args(["checkout", rev]).current_dir(path)).await
19+
Self::exec(|c| c.args(["checkout", rev, "--force"]).current_dir(path)).await
2020
}
2121

2222
pub(super) async fn pull(path: &Path) -> Result<()> {

yazi-config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![allow(clippy::module_inception)]
22

3-
yazi_macro::mod_pub!(keymap mgr open opener plugin popup preview scheme tasks theme which);
3+
yazi_macro::mod_pub!(keymap mgr open opener plugin popup preview tasks theme vfs which);
44

55
yazi_macro::mod_flat!(color icon layout pattern platform preset priority style yazi);
66

File renamed without changes.
File renamed without changes.

yazi-fs/src/provider/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
yazi_macro::mod_pub!(local);
1+
yazi_macro::mod_pub!(local sftp);
22

33
yazi_macro::mod_flat!(buffer dir_entry provider read_dir rw_file);

yazi-fs/src/provider/sftp/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yazi_macro::mod_flat!(sftp);

yazi-fs/src/provider/sftp/sftp.rs

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
use std::{io, path::{Path, PathBuf}};
2+
3+
use crate::cha::Cha;
4+
5+
pub struct Sftp;
6+
7+
impl Sftp {
8+
pub fn cache<P>(_: P) -> Option<PathBuf>
9+
where
10+
P: AsRef<Path>,
11+
{
12+
todo!()
13+
}
14+
15+
pub async fn canonicalize<P>(path: P) -> io::Result<PathBuf>
16+
where
17+
P: AsRef<Path>,
18+
{
19+
todo!()
20+
}
21+
22+
pub async fn copy<P, Q>(from: P, to: Q, cha: Cha) -> io::Result<u64>
23+
where
24+
P: AsRef<Path>,
25+
Q: AsRef<Path>,
26+
{
27+
todo!()
28+
}
29+
30+
pub async fn create<P>(path: P) -> io::Result<()>
31+
where
32+
P: AsRef<Path>,
33+
{
34+
todo!()
35+
}
36+
37+
pub async fn create_dir<P>(path: P) -> io::Result<()>
38+
where
39+
P: AsRef<Path>,
40+
{
41+
todo!()
42+
}
43+
44+
pub async fn create_dir_all<P>(path: P) -> io::Result<()>
45+
where
46+
P: AsRef<Path>,
47+
{
48+
todo!()
49+
}
50+
51+
pub async fn hard_link<P, Q>(original: P, link: Q) -> io::Result<()>
52+
where
53+
P: AsRef<Path>,
54+
Q: AsRef<Path>,
55+
{
56+
todo!()
57+
}
58+
59+
pub async fn metadata<P>(path: P) -> io::Result<std::fs::Metadata>
60+
where
61+
P: AsRef<Path>,
62+
{
63+
todo!()
64+
}
65+
66+
pub async fn open<P>(path: P) -> io::Result<()>
67+
where
68+
P: AsRef<Path>,
69+
{
70+
todo!()
71+
}
72+
73+
pub async fn read<P>(path: P) -> io::Result<Vec<u8>>
74+
where
75+
P: AsRef<Path>,
76+
{
77+
todo!()
78+
}
79+
80+
pub async fn read_dir<P>(path: P) -> io::Result<()>
81+
where
82+
P: AsRef<Path>,
83+
{
84+
todo!()
85+
}
86+
87+
pub fn read_dir_sync<P>(path: P) -> io::Result<()>
88+
where
89+
P: AsRef<Path>,
90+
{
91+
todo!()
92+
}
93+
94+
pub async fn read_link<P>(path: P) -> io::Result<PathBuf>
95+
where
96+
P: AsRef<Path>,
97+
{
98+
todo!()
99+
}
100+
101+
pub async fn read_to_string<P>(path: P) -> io::Result<String>
102+
where
103+
P: AsRef<Path>,
104+
{
105+
todo!()
106+
}
107+
108+
pub async fn remove_dir<P>(path: P) -> io::Result<()>
109+
where
110+
P: AsRef<Path>,
111+
{
112+
todo!()
113+
}
114+
115+
pub async fn remove_dir_all<P>(path: P) -> io::Result<()>
116+
where
117+
P: AsRef<Path>,
118+
{
119+
todo!()
120+
}
121+
122+
pub async fn remove_file<P>(path: P) -> io::Result<()>
123+
where
124+
P: AsRef<Path>,
125+
{
126+
todo!()
127+
}
128+
129+
pub async fn rename<P, Q>(from: P, to: Q) -> io::Result<()>
130+
where
131+
P: AsRef<Path>,
132+
Q: AsRef<Path>,
133+
{
134+
todo!()
135+
}
136+
137+
pub async fn symlink<P, Q, F>(original: P, link: Q, _is_dir: F) -> io::Result<()>
138+
where
139+
P: AsRef<Path>,
140+
Q: AsRef<Path>,
141+
F: AsyncFnOnce() -> io::Result<bool>,
142+
{
143+
todo!()
144+
}
145+
146+
pub async fn symlink_dir<P, Q>(original: P, link: Q) -> io::Result<()>
147+
where
148+
P: AsRef<Path>,
149+
Q: AsRef<Path>,
150+
{
151+
todo!()
152+
}
153+
154+
pub async fn symlink_file<P, Q>(original: P, link: Q) -> io::Result<()>
155+
where
156+
P: AsRef<Path>,
157+
Q: AsRef<Path>,
158+
{
159+
todo!()
160+
}
161+
162+
pub async fn symlink_metadata<P>(path: P) -> io::Result<std::fs::Metadata>
163+
where
164+
P: AsRef<Path>,
165+
{
166+
todo!()
167+
}
168+
169+
pub fn symlink_metadata_sync<P>(path: P) -> io::Result<std::fs::Metadata>
170+
where
171+
P: AsRef<Path>,
172+
{
173+
todo!()
174+
}
175+
176+
pub async fn trash<P>(path: P) -> io::Result<()>
177+
where
178+
P: AsRef<Path>,
179+
{
180+
todo!()
181+
}
182+
183+
pub async fn write<P, C>(path: P, contents: C) -> io::Result<()>
184+
where
185+
P: AsRef<Path>,
186+
C: AsRef<[u8]>,
187+
{
188+
todo!()
189+
}
190+
}

yazi-sftp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
## yazi-sftp
1+
# yazi-sftp
22

33
A fork of [`russh-sftp`](https://github.com/AspectUnk/russh-sftp) used by Yazi, with some changes:
44

55
- Supports paths containing invalid UTF-8
66
- Supports retrieving file nlink, username, and group
77
- Uses generic return parameters for a more idiomatic API, e.g.:
88
```rust
9-
let attrs: responses::Attrs = session.send(requests::Stat::new(path)).await?;
9+
let attrs: responses::Attrs = session.send(requests::Stat::new(path)).await?
1010
```
1111
- Reduced dependencies
1212
- Performance optimizations:

0 commit comments

Comments
 (0)