mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-21 07:03:12 +00:00
git: use &[&str] instead of &[String]
Using &[String] forces the caller to materalize owned strings if they have only references, which is costly. Using &[&str] makes it cheap if the caller owns strings as well.
This commit is contained in:
parent
681944954e
commit
6fd65cca30
@ -342,7 +342,7 @@ pub fn fetch(
|
||||
mut_repo: &mut MutableRepo,
|
||||
git_repo: &git2::Repository,
|
||||
remote_name: &str,
|
||||
globs: &[String],
|
||||
globs: &[&str],
|
||||
callbacks: RemoteCallbacks<'_>,
|
||||
git_settings: &GitSettings,
|
||||
) -> Result<Option<String>, GitFetchError> {
|
||||
|
@ -295,13 +295,14 @@ fn cmd_git_fetch(
|
||||
"fetch from git remote(s) {}",
|
||||
remotes.iter().join(",")
|
||||
));
|
||||
let branches = args.branch.iter().map(|b| b.as_str()).collect_vec();
|
||||
for remote in remotes {
|
||||
with_remote_callbacks(ui, |cb| {
|
||||
git::fetch(
|
||||
tx.mut_repo(),
|
||||
&git_repo,
|
||||
&remote,
|
||||
&args.branch,
|
||||
&branches,
|
||||
cb,
|
||||
&command.settings().git_settings(),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user