Skip to content

Commit 2b71f35

Browse files
authored
Merge branch 'extrawurst:master' into allow-multiline-commit-messgages
2 parents 35b5a18 + 5b69f77 commit 2b71f35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+251
-159
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
* add `regex-fancy` and `regex-onig` features to allow building Syntect with Onigumara regex engine instead of the default engine based on fancy-regex [[@jirutka](https://github.com/jirutka)]
2525
* add `vendor-openssl` feature to allow building without vendored openssl [[@jirutka](https://github.com/jirutka)]
2626
* allow copying marked commits [[@remique](https://github.com/remique)] ([#1288](https://github.com/extrawurst/gitui/issues/1288))
27+
* display tags and branches in the log view [[@alexmaco]](https://github.com/alexmaco)([#1371](https://github.com/extrawurst/gitui/pull/1371))
28+
* display current repository path in the top-right corner [[@alexmaco]](https://github.com/alexmaco)([#1387](https://github.com/extrawurst/gitui/pull/1387))
2729

2830
### Fixes
2931
* remove insecure dependency `ansi_term` ([#1290](https://github.com/extrawurst/gitui/issues/1290))

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,7 @@ install-timing:
6969
cargo install --features=timing --path "." --offline
7070

7171
licenses:
72-
cargo bundle-licenses --format toml --output THIRDPARTY.toml
72+
cargo bundle-licenses --format toml --output THIRDPARTY.toml
73+
74+
clean:
75+
cargo clean

THEMES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Notes:
1818
* rgb colors might not be supported in every terminal.
1919
* using a color like `yellow` might appear in whatever your terminal/theme defines for `yellow`
2020
* valid colors can be found in tui-rs' [Color](https://docs.rs/tui/0.12.0/tui/style/enum.Color.html) struct.
21-
* all customizable theme elements can be found in `style.rs` in the `impl Default for Theme` block
21+
* all customizable theme elements can be found in [`style.rs` in the `impl Default for Theme` block](https://github.com/extrawurst/gitui/blob/master/src/ui/style.rs#L305)

asyncgit/src/asyncjob/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ mod test {
207207
let res =
208208
self.v.fetch_add(self.value_to_add, Ordering::SeqCst);
209209

210-
println!("[job] value: {}", res);
210+
println!("[job] value: {res}");
211211

212212
Ok(())
213213
}
@@ -236,8 +236,8 @@ mod test {
236236
}
237237

238238
println!("recv");
239-
let _foo = receiver.recv().unwrap();
240-
let _foo = receiver.recv().unwrap();
239+
receiver.recv().unwrap();
240+
receiver.recv().unwrap();
241241
assert!(receiver.is_empty());
242242

243243
assert_eq!(
@@ -282,7 +282,7 @@ mod test {
282282
wait_for_job(&job);
283283

284284
println!("recv");
285-
let _foo = receiver.recv().unwrap();
285+
receiver.recv().unwrap();
286286
println!("received");
287287

288288
assert_eq!(

asyncgit/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ pub type Result<T> = std::result::Result<T, Error>;
8383

8484
impl<T> From<std::sync::PoisonError<T>> for Error {
8585
fn from(error: std::sync::PoisonError<T>) -> Self {
86-
Self::Generic(format!("poison error: {}", error))
86+
Self::Generic(format!("poison error: {error}"))
8787
}
8888
}
8989

9090
impl<T> From<crossbeam_channel::SendError<T>> for Error {
9191
fn from(error: crossbeam_channel::SendError<T>) -> Self {
92-
Self::Generic(format!("send error: {}", error))
92+
Self::Generic(format!("send error: {error}"))
9393
}
9494
}

asyncgit/src/sync/blame.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,15 @@ mod tests {
170170
let repo_path: &RepoPath =
171171
&root.as_os_str().to_str().unwrap().into();
172172

173-
assert!(matches!(
174-
blame_file(&repo_path, "foo", None),
175-
Err(_)
176-
));
173+
assert!(matches!(blame_file(repo_path, "foo", None), Err(_)));
177174

178175
File::create(&root.join(file_path))?
179176
.write_all(b"line 1\n")?;
180177

181178
stage_add_file(repo_path, file_path)?;
182179
commit(repo_path, "first commit")?;
183180

184-
let blame = blame_file(&repo_path, "foo", None)?;
181+
let blame = blame_file(repo_path, "foo", None)?;
185182

186183
assert!(matches!(
187184
blame.lines.as_slice(),
@@ -205,7 +202,7 @@ mod tests {
205202
stage_add_file(repo_path, file_path)?;
206203
commit(repo_path, "second commit")?;
207204

208-
let blame = blame_file(&repo_path, "foo", None)?;
205+
let blame = blame_file(repo_path, "foo", None)?;
209206

210207
assert!(matches!(
211208
blame.lines.as_slice(),
@@ -232,14 +229,14 @@ mod tests {
232229

233230
file.write(b"line 3\n")?;
234231

235-
let blame = blame_file(&repo_path, "foo", None)?;
232+
let blame = blame_file(repo_path, "foo", None)?;
236233

237234
assert_eq!(blame.lines.len(), 2);
238235

239236
stage_add_file(repo_path, file_path)?;
240237
commit(repo_path, "third commit")?;
241238

242-
let blame = blame_file(&repo_path, "foo", None)?;
239+
let blame = blame_file(repo_path, "foo", None)?;
243240

244241
assert_eq!(blame.lines.len(), 3);
245242

@@ -264,6 +261,6 @@ mod tests {
264261
stage_add_file(repo_path, file_path).unwrap();
265262
commit(repo_path, "first commit").unwrap();
266263

267-
assert!(blame_file(&repo_path, "bar\\foo", None).is_ok());
264+
assert!(blame_file(repo_path, "bar\\foo", None).is_ok());
268265
}
269266
}

asyncgit/src/sync/branch/merge_commit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ mod test {
158158
false,
159159
false,
160160
None,
161-
None.into(),
161+
None,
162162
)
163163
.is_err());
164164

@@ -195,7 +195,7 @@ mod test {
195195
//verify commit msg
196196
let details = crate::sync::get_commit_details(
197197
&clone2_dir.into(),
198-
merge_commit.into(),
198+
merge_commit,
199199
)
200200
.unwrap();
201201
assert_eq!(

asyncgit/src/sync/branch/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub(crate) fn branch_set_upstream(
206206

207207
if branch.upstream().is_err() {
208208
let remote = get_default_remote_in_repo(repo)?;
209-
let upstream_name = format!("{}/{}", remote, branch_name);
209+
let upstream_name = format!("{remote}/{branch_name}");
210210
branch.set_upstream(Some(upstream_name.as_str()))?;
211211
}
212212

asyncgit/src/sync/branch/rename.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn rename_branch(
2424

2525
#[cfg(test)]
2626
mod test {
27-
use super::super::*;
27+
use super::super::{checkout_branch, create_branch, RepoPath};
2828
use super::rename_branch;
2929
use crate::sync::tests::repo_init;
3030

@@ -42,7 +42,7 @@ mod test {
4242
assert_eq!(
4343
repo.branches(None)
4444
.unwrap()
45-
.nth(0)
45+
.next()
4646
.unwrap()
4747
.unwrap()
4848
.0
@@ -58,7 +58,7 @@ mod test {
5858
assert_eq!(
5959
repo.branches(None)
6060
.unwrap()
61-
.nth(0)
61+
.next()
6262
.unwrap()
6363
.unwrap()
6464
.0

asyncgit/src/sync/commit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ mod tests {
138138

139139
fn count_commits(repo: &Repository, max: usize) -> usize {
140140
let mut items = Vec::new();
141-
let mut walk = LogWalker::new(&repo, max).unwrap();
141+
let mut walk = LogWalker::new(repo, max).unwrap();
142142
walk.read(&mut items).unwrap();
143143
items.len()
144144
}

asyncgit/src/sync/commit_details.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl CommitMessage {
6060
///
6161
pub fn combine(self) -> String {
6262
if let Some(body) = self.body {
63-
format!("{}\n{}", self.subject, body)
63+
format!("{}\n{body}", self.subject)
6464
} else {
6565
self.subject
6666
}
@@ -82,6 +82,8 @@ pub struct CommitDetails {
8282

8383
impl CommitDetails {
8484
///
85+
#[allow(clippy::missing_const_for_fn)]
86+
// clippy doesn't realise indexing a String is not const
8587
pub fn short_hash(&self) -> &str {
8688
&self.hash[0..7]
8789
}

asyncgit/src/sync/commits_info.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ mod tests {
164164
stage_add_file(repo_path, file_path).unwrap();
165165
let c2 = commit(repo_path, "commit2").unwrap();
166166

167-
let res =
168-
get_commits_info(repo_path, &vec![c2, c1], 50).unwrap();
167+
let res = get_commits_info(repo_path, &[c2, c1], 50).unwrap();
169168

170169
assert_eq!(res.len(), 2);
171170
assert_eq!(res[0].message.as_str(), "commit2");
@@ -187,7 +186,7 @@ mod tests {
187186
stage_add_file(repo_path, file_path).unwrap();
188187
let c1 = commit(repo_path, "subject\nbody").unwrap();
189188

190-
let res = get_commits_info(repo_path, &vec![c1], 50).unwrap();
189+
let res = get_commits_info(repo_path, &[c1], 50).unwrap();
191190

192191
assert_eq!(res.len(), 1);
193192
assert_eq!(res[0].message.as_str(), "subject");
@@ -211,7 +210,7 @@ mod tests {
211210

212211
let res = get_commits_info(
213212
repo_path,
214-
&vec![get_head_repo(&repo).unwrap().into()],
213+
&[get_head_repo(&repo).unwrap()],
215214
50,
216215
)
217216
.unwrap();

asyncgit/src/sync/hooks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl HookPaths {
8787
} else {
8888
let err = String::from_utf8_lossy(&output.stderr);
8989
let out = String::from_utf8_lossy(&output.stdout);
90-
let formatted = format!("{}{}", out, err);
90+
let formatted = format!("{out}{err}");
9191

9292
Ok(HookResult::NotOk(formatted))
9393
}
@@ -324,7 +324,7 @@ exit 1
324324
let workdir = TempDir::new().unwrap();
325325
let git_root = git_root.into_path();
326326
let repo_path = &RepoPath::Workdir {
327-
gitdir: dbg!(git_root.to_path_buf()),
327+
gitdir: dbg!(git_root),
328328
workdir: dbg!(workdir.into_path()),
329329
};
330330

@@ -541,7 +541,7 @@ exit 1
541541
let workdir = TempDir::new().unwrap();
542542
let git_root = git_root.into_path();
543543
let repo_path = &RepoPath::Workdir {
544-
gitdir: dbg!(git_root.to_path_buf()),
544+
gitdir: dbg!(git_root),
545545
workdir: dbg!(workdir.path().to_path_buf()),
546546
};
547547

asyncgit/src/sync/logwalker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ mod tests {
162162
walk.read(&mut items).unwrap();
163163

164164
assert_eq!(items.len(), 1);
165-
assert_eq!(items[0], oid2.into());
165+
assert_eq!(items[0], oid2);
166166

167167
Ok(())
168168
}
@@ -190,7 +190,7 @@ mod tests {
190190
dbg!(&info);
191191

192192
assert_eq!(items.len(), 2);
193-
assert_eq!(items[0], oid2.into());
193+
assert_eq!(items[0], oid2);
194194

195195
let mut items = Vec::new();
196196
walk.read(&mut items).unwrap();
@@ -235,7 +235,7 @@ mod tests {
235235
walker.read(&mut items).unwrap();
236236

237237
assert_eq!(items.len(), 1);
238-
assert_eq!(items[0], second_commit_id.into());
238+
assert_eq!(items[0], second_commit_id);
239239

240240
let mut items = Vec::new();
241241
walker.read(&mut items).unwrap();

asyncgit/src/sync/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ mod tests {
125125
let temp_dir = TempDir::new().unwrap();
126126
let path = temp_dir.path();
127127

128-
set_search_path(ConfigLevel::System, &path).unwrap();
129-
set_search_path(ConfigLevel::Global, &path).unwrap();
130-
set_search_path(ConfigLevel::XDG, &path).unwrap();
131-
set_search_path(ConfigLevel::ProgramData, &path).unwrap();
128+
set_search_path(ConfigLevel::System, path).unwrap();
129+
set_search_path(ConfigLevel::Global, path).unwrap();
130+
set_search_path(ConfigLevel::XDG, path).unwrap();
131+
set_search_path(ConfigLevel::ProgramData, path).unwrap();
132132
});
133133
}
134134

@@ -279,7 +279,7 @@ mod tests {
279279
.try_init();
280280
}
281281

282-
/// Same as repo_init, but the repo is a bare repo (--bare)
282+
/// Same as `repo_init`, but the repo is a bare repo (--bare)
283283
pub fn repo_init_bare() -> Result<(TempDir, Repository)> {
284284
init_log();
285285

@@ -303,7 +303,7 @@ mod tests {
303303
///
304304
pub fn debug_cmd_print(path: &RepoPath, cmd: &str) {
305305
let cmd = debug_cmd(path, cmd);
306-
eprintln!("\n----\n{}", cmd);
306+
eprintln!("\n----\n{cmd}");
307307
}
308308

309309
/// helper to fetch commmit details using log walker
@@ -323,7 +323,7 @@ mod tests {
323323
fn debug_cmd(path: &RepoPath, cmd: &str) -> String {
324324
let output = if cfg!(target_os = "windows") {
325325
Command::new("cmd")
326-
.args(&["/C", cmd])
326+
.args(["/C", cmd])
327327
.current_dir(path.gitpath())
328328
.output()
329329
.unwrap()
@@ -343,12 +343,12 @@ mod tests {
343343
if stdout.is_empty() {
344344
String::new()
345345
} else {
346-
format!("out:\n{}", stdout)
346+
format!("out:\n{stdout}")
347347
},
348348
if stderr.is_empty() {
349349
String::new()
350350
} else {
351-
format!("err:\n{}", stderr)
351+
format!("err:\n{stderr}")
352352
}
353353
)
354354
}

asyncgit/src/sync/rebase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ mod test_conflict_free_rebase {
202202
.find_commit(c.into())
203203
.unwrap()
204204
.parent_ids()
205-
.map(|id| CommitId::from(id))
205+
.map(CommitId::from)
206206
.collect();
207207

208208
foo

asyncgit/src/sync/remotes/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ mod tests {
216216

217217
debug_cmd_print(
218218
repo_path,
219-
&format!("git remote add second {}", remote_path)[..],
219+
&format!("git remote add second {remote_path}")[..],
220220
);
221221

222222
let remotes = get_remotes(repo_path).unwrap();
@@ -251,7 +251,7 @@ mod tests {
251251

252252
debug_cmd_print(
253253
repo_path,
254-
&format!("git remote add origin {}", remote_path)[..],
254+
&format!("git remote add origin {remote_path}")[..],
255255
);
256256

257257
//NOTE: aparently remotes are not chronolically sorted but alphabetically
@@ -287,7 +287,7 @@ mod tests {
287287

288288
debug_cmd_print(
289289
repo_path,
290-
&format!("git remote add someremote {}", remote_path)[..],
290+
&format!("git remote add someremote {remote_path}")[..],
291291
);
292292

293293
let remotes = get_remotes(repo_path).unwrap();

0 commit comments

Comments
 (0)