mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-03 18:30:35 +08:00
fmt: remove .rustfmt.toml
The formatting configuration is not worth the maintenance of a nightly version. Remove it and allow the default formatting to be used instead. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
max_width = 100
|
||||
# yeap
|
||||
comment_width = 80
|
||||
wrap_comments = true
|
||||
hard_tabs = false
|
||||
tab_spaces = 4
|
||||
imports_layout = "HorizontalVertical"
|
||||
imports_granularity = "Crate"
|
||||
|
||||
newline_style = "Unix"
|
||||
use_small_heuristics = "Default"
|
||||
|
||||
reorder_imports = true
|
||||
reorder_modules = true
|
||||
|
||||
remove_nested_parens = true
|
||||
|
||||
fn_args_layout = "Tall"
|
||||
|
||||
edition = "2018"
|
||||
|
||||
match_block_trailing_comma = true
|
||||
|
||||
merge_derives = true
|
||||
|
||||
use_try_shorthand = false
|
||||
use_field_init_shorthand = false
|
||||
|
||||
force_explicit_abi = true
|
||||
@@ -16,12 +16,9 @@ use git_ext::{
|
||||
use crate::{
|
||||
odb,
|
||||
refdb::{
|
||||
self,
|
||||
resolve,
|
||||
self, resolve,
|
||||
write::{previous, Applied, Policy, SymrefTarget, Update, Updated},
|
||||
Read as _,
|
||||
Reference,
|
||||
Target,
|
||||
Read as _, Reference, Target,
|
||||
},
|
||||
signature::UserInfo,
|
||||
};
|
||||
@@ -67,7 +64,7 @@ impl Write {
|
||||
.external_template(false),
|
||||
)?;
|
||||
Ok(backend)
|
||||
},
|
||||
}
|
||||
Ok(repo) => Ok(repo),
|
||||
Err(e) => Err(e),
|
||||
}?;
|
||||
@@ -225,7 +222,7 @@ impl<'a> Transaction<'a> {
|
||||
} else {
|
||||
None
|
||||
}
|
||||
},
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
|
||||
@@ -289,7 +286,7 @@ impl<'a> Transaction<'a> {
|
||||
Some(src) => match src.target {
|
||||
Target::Direct { .. } if matches!(type_change, Policy::Abort) => {
|
||||
Err(error::Update::TypeChange(name.into()))
|
||||
},
|
||||
}
|
||||
Target::Direct { .. } if matches!(type_change, Policy::Reject) => {
|
||||
Ok(Either::Left(Update::Symbolic {
|
||||
name,
|
||||
@@ -298,7 +295,7 @@ impl<'a> Transaction<'a> {
|
||||
previous,
|
||||
reflog,
|
||||
}))
|
||||
},
|
||||
}
|
||||
_ => {
|
||||
let dst = self.refdb.find_reference(&target.name)?;
|
||||
match dst {
|
||||
@@ -309,14 +306,14 @@ impl<'a> Transaction<'a> {
|
||||
Ok(Either::Right(
|
||||
self.symbolic_edit(name, target, prev, &reflog, is_ff)?,
|
||||
))
|
||||
},
|
||||
}
|
||||
Target::Symbolic { .. } => Err(error::Update::TargetSymbolic(dst.name)),
|
||||
},
|
||||
None => Ok(Either::Right(
|
||||
self.symbolic_edit(name, target, prev, &reflog, true)?,
|
||||
)),
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
None => Ok(Either::Right(
|
||||
self.symbolic_edit(name, target, prev, &reflog, true)?,
|
||||
@@ -355,7 +352,7 @@ impl<'a> Transaction<'a> {
|
||||
match given {
|
||||
None => {
|
||||
panic!("BUG: the previous value for a reference to be removed was not given, but its existence SHOULD be guarded")
|
||||
},
|
||||
}
|
||||
Some(previous) => Ok(Either::Right(self.remove_edit(name, previous)?)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ impl<'a> TryFrom<git2::Reference<'a>> for Reference {
|
||||
.ok_or(ParseReference::InvalidUtf8)
|
||||
.and_then(|name| RefString::try_from(name).map_err(ParseReference::from))?;
|
||||
name.into()
|
||||
},
|
||||
}
|
||||
Some(oid) => oid.into(),
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ impl<'a, G: glob::Pattern + Debug> Iterator for ReferencesGlob<'a, G> {
|
||||
Ok(reference) => match reference.name() {
|
||||
Some(name) if self.glob.matches(name) => {
|
||||
return Some(Reference::try_from(reference).map_err(error::Iter::from))
|
||||
},
|
||||
}
|
||||
_ => continue,
|
||||
},
|
||||
|
||||
|
||||
@@ -55,14 +55,14 @@ impl Edit {
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
}
|
||||
Self::MustNotExist => {
|
||||
if given.is_some() {
|
||||
Err(DoesExist)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
}
|
||||
Self::MustExistAndMatch(expected) => match given {
|
||||
Some(given) if &given == expected => Ok(()),
|
||||
Some(given) => Err(DoesNotMatch {
|
||||
@@ -118,7 +118,7 @@ impl Remove {
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
}
|
||||
Self::MustExistAndMatch(expected) => match given {
|
||||
Some(given) if &given == expected => Ok(()),
|
||||
Some(given) => Err(DoesNotMatch {
|
||||
|
||||
@@ -8,18 +8,12 @@ use std::convert::TryFrom;
|
||||
use minicbor::{
|
||||
decode,
|
||||
encode::{self, Write},
|
||||
Decode,
|
||||
Decoder,
|
||||
Encode,
|
||||
Encoder,
|
||||
Decode, Decoder, Encode, Encoder,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
refspec::{PatternStr, PatternString},
|
||||
Namespaced,
|
||||
Qualified,
|
||||
RefStr,
|
||||
RefString,
|
||||
Namespaced, Qualified, RefStr, RefString,
|
||||
};
|
||||
|
||||
impl<'de: 'a, 'a> Decode<'de> for &'a RefStr {
|
||||
|
||||
@@ -101,6 +101,6 @@ pub fn ref_format(opts: Options, s: &str) -> Result<(), Error> {
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,9 @@ use std::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
lit,
|
||||
name,
|
||||
lit, name,
|
||||
refspec::{PatternStr, QualifiedPattern},
|
||||
Component,
|
||||
RefStr,
|
||||
RefString,
|
||||
Component, RefStr, RefString,
|
||||
};
|
||||
|
||||
/// A fully-qualified refname.
|
||||
|
||||
@@ -14,8 +14,7 @@ use std::{
|
||||
use crate::{
|
||||
check,
|
||||
refspec::{PatternStr, PatternString},
|
||||
Namespaced,
|
||||
Qualified,
|
||||
Namespaced, Qualified,
|
||||
};
|
||||
|
||||
mod iter;
|
||||
@@ -285,7 +284,7 @@ impl RefString {
|
||||
Some(idx) => {
|
||||
self.0.truncate(idx);
|
||||
true
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ impl PatternString {
|
||||
Some(idx) => {
|
||||
self.0.truncate(idx);
|
||||
true
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,7 @@ use ::serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||
|
||||
use crate::{
|
||||
refspec::{PatternStr, PatternString},
|
||||
Namespaced,
|
||||
Qualified,
|
||||
RefStr,
|
||||
RefString,
|
||||
Namespaced, Qualified, RefStr, RefString,
|
||||
};
|
||||
|
||||
impl<'de: 'a, 'a> Deserialize<'de> for &'a RefStr {
|
||||
|
||||
@@ -38,11 +38,11 @@ pub fn refname(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
};
|
||||
TokenStream::from(expand)
|
||||
},
|
||||
}
|
||||
|
||||
Err(e) => {
|
||||
abort!(lit.span(), "invalid refname literal: {}", e);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,20 +75,20 @@ pub fn qualified(input: TokenStream) -> TokenStream {
|
||||
};
|
||||
|
||||
TokenStream::from(expand)
|
||||
},
|
||||
}
|
||||
|
||||
None => {
|
||||
abort!(
|
||||
lit.span(),
|
||||
"refname is not of the form 'refs/<category>/<name>'"
|
||||
);
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Err(e) => {
|
||||
abort!(lit.span(), "invalid refname literal: {}", e);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,17 +121,17 @@ pub fn component(input: TokenStream) -> TokenStream {
|
||||
};
|
||||
|
||||
TokenStream::from(expand)
|
||||
},
|
||||
}
|
||||
|
||||
None => {
|
||||
abort!(lit.span(), "component contains a '/'");
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Err(e) => {
|
||||
abort!(lit.span(), "invalid refname literal: {}", e);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,10 +159,10 @@ pub fn pattern(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
};
|
||||
TokenStream::from(expand)
|
||||
},
|
||||
}
|
||||
|
||||
Err(e) => {
|
||||
abort!(lit.span(), "invalid refspec pattern literal: {}", e);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,17 +124,8 @@
|
||||
#[cfg(feature = "percent-encoding")]
|
||||
pub use git_ref_format_core::PercentEncode;
|
||||
pub use git_ref_format_core::{
|
||||
check_ref_format,
|
||||
lit,
|
||||
name::component,
|
||||
Component,
|
||||
DuplicateGlob,
|
||||
Error,
|
||||
Namespaced,
|
||||
Options,
|
||||
Qualified,
|
||||
RefStr,
|
||||
RefString,
|
||||
check_ref_format, lit, name::component, Component, DuplicateGlob, Error, Namespaced, Options,
|
||||
Qualified, RefStr, RefString,
|
||||
};
|
||||
|
||||
pub mod name {
|
||||
|
||||
@@ -122,7 +122,7 @@ impl FromStr for Author {
|
||||
let hours = tz_offset / 100;
|
||||
let minutes = tz_offset % 100;
|
||||
hours * 60 + minutes
|
||||
},
|
||||
}
|
||||
};
|
||||
let time = match components.next_back() {
|
||||
None => return Err(ParseError::Missing("time")),
|
||||
|
||||
@@ -83,13 +83,13 @@ impl<'a> Blob<'a> {
|
||||
git.find_reference(&name).or_matches(is_not_found_err, || {
|
||||
Err(Error::NotFound(NotFound::NoSuchBranch(name.into_owned())))
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
Branch::Ref(reference) => Ok(reference),
|
||||
}?;
|
||||
let tree = reference.peel_to_tree()?;
|
||||
blob(git, tree, path)
|
||||
},
|
||||
}
|
||||
|
||||
Self::Init { branch, path } => {
|
||||
let start = match branch {
|
||||
@@ -100,7 +100,7 @@ impl<'a> Blob<'a> {
|
||||
(_, Some(sym)) => Ok(revwalk::Start::Ref(sym.to_string())),
|
||||
(_, _) => Err(Error::NotFound(NotFound::NoRefTarget)),
|
||||
}
|
||||
},
|
||||
}
|
||||
}?;
|
||||
|
||||
let revwalk = revwalk::FirstParent::new(git, start)?.reverse()?;
|
||||
@@ -112,9 +112,9 @@ impl<'a> Blob<'a> {
|
||||
let oid = oid?;
|
||||
let tree = git.find_commit(oid)?.tree()?;
|
||||
blob(git, tree, path)
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Self::At { object, path } => {
|
||||
let tree = git
|
||||
@@ -124,7 +124,7 @@ impl<'a> Blob<'a> {
|
||||
})
|
||||
.and_then(|obj| Ok(obj.peel_to_tree()?))?;
|
||||
blob(git, tree, path)
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,11 +70,11 @@ impl Tree<'_> {
|
||||
Blob(data) => {
|
||||
let oid = repo.blob(data)?;
|
||||
builder.insert(name.as_ref(), oid, git2::FileMode::Blob.into())?;
|
||||
},
|
||||
}
|
||||
Tree(sub) => {
|
||||
let oid = sub.write(repo)?;
|
||||
builder.insert(name.as_ref(), oid, git2::FileMode::Tree.into())?;
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
use radicle_git_ext::ref_format::{
|
||||
component,
|
||||
name,
|
||||
qualified,
|
||||
refname,
|
||||
refspec,
|
||||
Error,
|
||||
Qualified,
|
||||
RefStr,
|
||||
RefString,
|
||||
component, name, qualified, refname, refspec, Error, Qualified, RefStr, RefString,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{
|
||||
env,
|
||||
fs,
|
||||
env, fs,
|
||||
fs::File,
|
||||
io,
|
||||
path::{Path, PathBuf},
|
||||
|
||||
@@ -36,7 +36,7 @@ fn main() {
|
||||
None => {
|
||||
print_usage();
|
||||
return;
|
||||
},
|
||||
}
|
||||
};
|
||||
let repo = Repository::discover(repo_path).unwrap();
|
||||
let now = Instant::now();
|
||||
|
||||
@@ -42,7 +42,7 @@ fn get_options_or_exit() -> Options {
|
||||
Err(message) => {
|
||||
println!("{message}");
|
||||
std::process::exit(1);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ fn init_repository_or_exit(path_to_repo: &str) -> Repository {
|
||||
Err(e) => {
|
||||
println!("Failed to create repository: {e:?}");
|
||||
std::process::exit(1);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ where
|
||||
Err(_) => {
|
||||
let encoded = base64::encode(bytes);
|
||||
state.serialize_field("content", &encoded)?
|
||||
},
|
||||
}
|
||||
};
|
||||
state.serialize_field("lastCommit", &self.commit)?;
|
||||
state.end()
|
||||
@@ -162,7 +162,7 @@ impl<'a> Serialize for BlobRef<'a> {
|
||||
Err(_) => {
|
||||
let encoded = base64::encode(bytes);
|
||||
state.serialize_field("content", &encoded)?
|
||||
},
|
||||
}
|
||||
};
|
||||
state.end()
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ impl Local {
|
||||
name: name.as_ref().to_ref_string(),
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -381,23 +381,23 @@ impl Serialize for FileDiff {
|
||||
FileDiff::Added(x) => {
|
||||
state.serialize_field("path", &x.path)?;
|
||||
state.serialize_field("diff", &x.diff)?;
|
||||
},
|
||||
}
|
||||
FileDiff::Deleted(x) => {
|
||||
state.serialize_field("path", &x.path)?;
|
||||
state.serialize_field("diff", &x.diff)?;
|
||||
},
|
||||
}
|
||||
FileDiff::Modified(x) => {
|
||||
state.serialize_field("path", &x.path)?;
|
||||
state.serialize_field("diff", &x.diff)?;
|
||||
},
|
||||
}
|
||||
FileDiff::Moved(x) => {
|
||||
state.serialize_field("oldPath", &x.old_path)?;
|
||||
state.serialize_field("newPath", &x.new_path)?;
|
||||
},
|
||||
}
|
||||
FileDiff::Copied(x) => {
|
||||
state.serialize_field("oldPath", &x.old_path)?;
|
||||
state.serialize_field("newPath", &x.new_path)?;
|
||||
},
|
||||
}
|
||||
}
|
||||
state.end()
|
||||
}
|
||||
@@ -555,14 +555,14 @@ impl Serialize for Modification {
|
||||
map.serialize_entry("lineNo", &addition.line_no)?;
|
||||
map.serialize_entry("type", "addition")?;
|
||||
map.end()
|
||||
},
|
||||
}
|
||||
Modification::Deletion(deletion) => {
|
||||
let mut map = serializer.serialize_map(Some(3))?;
|
||||
map.serialize_entry("line", &deletion.line)?;
|
||||
map.serialize_entry("lineNo", &deletion.line_no)?;
|
||||
map.serialize_entry("type", "deletion")?;
|
||||
map.end()
|
||||
},
|
||||
}
|
||||
Modification::Context {
|
||||
line,
|
||||
line_no_old,
|
||||
@@ -574,7 +574,7 @@ impl Serialize for Modification {
|
||||
map.serialize_entry("lineNoNew", line_no_new)?;
|
||||
map.serialize_entry("type", "context")?;
|
||||
map.end()
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,16 +18,7 @@
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use super::{
|
||||
Diff,
|
||||
DiffContent,
|
||||
DiffFile,
|
||||
EofNewLine,
|
||||
FileMode,
|
||||
FileStats,
|
||||
Hunk,
|
||||
Hunks,
|
||||
Line,
|
||||
Modification,
|
||||
Diff, DiffContent, DiffFile, EofNewLine, FileMode, FileStats, Hunk, Hunks, Line, Modification,
|
||||
Stats,
|
||||
};
|
||||
|
||||
@@ -168,24 +159,24 @@ impl TryFrom<git2::Patch<'_>> for DiffContent {
|
||||
new_missing_eof = true;
|
||||
old_missing_eof = true;
|
||||
continue;
|
||||
},
|
||||
}
|
||||
git2::DiffLineType::Addition => {
|
||||
additions += 1;
|
||||
},
|
||||
}
|
||||
git2::DiffLineType::Deletion => {
|
||||
deletions += 1;
|
||||
},
|
||||
}
|
||||
git2::DiffLineType::AddEOFNL => {
|
||||
additions += 1;
|
||||
old_missing_eof = true;
|
||||
continue;
|
||||
},
|
||||
}
|
||||
git2::DiffLineType::DeleteEOFNL => {
|
||||
deletions += 1;
|
||||
new_missing_eof = true;
|
||||
continue;
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
let line = Modification::try_from(line)?;
|
||||
lines.push(line);
|
||||
@@ -254,7 +245,7 @@ impl<'a> TryFrom<git2::Diff<'a>> for Diff {
|
||||
Delta::Copied => copied(&mut diff, &git_diff, idx, &delta)?,
|
||||
status => {
|
||||
return Err(error::Diff::DeltaUnhandled(status));
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ impl Entry {
|
||||
.then(|| repo.find_submodule(&name))
|
||||
.transpose()?;
|
||||
Ok(Self::Submodule(Submodule::new(name, path, submodule, id)?))
|
||||
},
|
||||
}
|
||||
_ => Err(error::Directory::InvalidType(path, "tree or blob")),
|
||||
}
|
||||
}
|
||||
@@ -396,21 +396,21 @@ impl Directory {
|
||||
Entry::File(_) => {
|
||||
entries.insert(entry.name().clone(), entry);
|
||||
git2::TreeWalkResult::Ok
|
||||
},
|
||||
}
|
||||
Entry::Directory(_) => {
|
||||
entries.insert(entry.name().clone(), entry);
|
||||
// Skip nested directories
|
||||
git2::TreeWalkResult::Skip
|
||||
},
|
||||
}
|
||||
Entry::Submodule(_) => {
|
||||
entries.insert(entry.name().clone(), entry);
|
||||
git2::TreeWalkResult::Ok
|
||||
},
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
error = Some(err);
|
||||
git2::TreeWalkResult::Abort
|
||||
},
|
||||
}
|
||||
}
|
||||
})?;
|
||||
|
||||
@@ -520,7 +520,7 @@ impl Directory {
|
||||
Entry::Directory(directory) => {
|
||||
let acc = directory.traverse(repo, acc, f)?;
|
||||
f(acc, entry)
|
||||
},
|
||||
}
|
||||
Entry::Submodule(_) => f(acc, entry),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,12 +18,9 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use git_ext::ref_format::{
|
||||
self,
|
||||
refname,
|
||||
self, refname,
|
||||
refspec::{self, PatternString, QualifiedPattern},
|
||||
Qualified,
|
||||
RefStr,
|
||||
RefString,
|
||||
Qualified, RefStr, RefString,
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
|
||||
@@ -24,11 +24,7 @@ use std::{
|
||||
use git_ext::ref_format::{
|
||||
self,
|
||||
refspec::{NamespacedPattern, PatternString, QualifiedPattern},
|
||||
Component,
|
||||
Namespaced,
|
||||
Qualified,
|
||||
RefStr,
|
||||
RefString,
|
||||
Component, Namespaced, Qualified, RefStr, RefString,
|
||||
};
|
||||
use nonempty::NonEmpty;
|
||||
use thiserror::Error;
|
||||
|
||||
@@ -44,7 +44,7 @@ impl<'a> Iterator for Tags<'a> {
|
||||
res.map_err(error::Tag::from)
|
||||
.and_then(|r| Tag::try_from(&r).map_err(error::Tag::from)),
|
||||
);
|
||||
},
|
||||
}
|
||||
None => self.current += 1,
|
||||
},
|
||||
None => break,
|
||||
@@ -67,7 +67,7 @@ impl<'a> Iterator for TagNames<'a> {
|
||||
.map(|name| lit::refs_tags(name).into())
|
||||
.map_err(error::Tag::from)
|
||||
}))
|
||||
},
|
||||
}
|
||||
None => self.inner.current += 1,
|
||||
},
|
||||
None => break,
|
||||
@@ -111,7 +111,7 @@ impl<'a> Iterator for Branches<'a> {
|
||||
res.map_err(error::Branch::from)
|
||||
.and_then(|r| Branch::try_from(&r).map_err(error::Branch::from)),
|
||||
)
|
||||
},
|
||||
}
|
||||
None => self.current += 1,
|
||||
},
|
||||
None => break,
|
||||
@@ -134,7 +134,7 @@ impl<'a> Iterator for BranchNames<'a> {
|
||||
.map(|branch| branch.refname().into_owned())
|
||||
.map_err(error::Branch::from)
|
||||
}))
|
||||
},
|
||||
}
|
||||
None => self.inner.current += 1,
|
||||
},
|
||||
None => break,
|
||||
@@ -194,7 +194,7 @@ impl<'a> Iterator for Categories<'a> {
|
||||
let (_refs, category, c, cs) = name.non_empty_components();
|
||||
Ok((category.to_ref_string(), refstr_join(c, cs)))
|
||||
}));
|
||||
},
|
||||
}
|
||||
None => self.current += 1,
|
||||
},
|
||||
None => break,
|
||||
|
||||
@@ -33,17 +33,7 @@ use crate::{
|
||||
fs::{Directory, File, FileContent},
|
||||
refs::{BranchNames, Branches, Categories, Namespaces, TagNames, Tags},
|
||||
tree::{Entry, Tree},
|
||||
Branch,
|
||||
Commit,
|
||||
Error,
|
||||
Glob,
|
||||
History,
|
||||
Namespace,
|
||||
Revision,
|
||||
Signature,
|
||||
Stats,
|
||||
Tag,
|
||||
ToCommit,
|
||||
Branch, Commit, Error, Glob, History, Namespace, Revision, Signature, Stats, Tag, ToCommit,
|
||||
};
|
||||
|
||||
/// Enumeration of errors that can occur in repo operations.
|
||||
@@ -405,7 +395,7 @@ impl Repository {
|
||||
} else {
|
||||
Err(error.into())
|
||||
}
|
||||
},
|
||||
}
|
||||
Ok(sig) => Ok(Some(Signature::from(sig.0))),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ impl TryFrom<&git2::Reference<'_>> for Tag {
|
||||
id: commit.id().into(),
|
||||
name,
|
||||
})
|
||||
},
|
||||
}
|
||||
Err(err) => Err(err.into()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@ use std::path::Path;
|
||||
use radicle_git_ext::ref_format::refname;
|
||||
use radicle_surf::{
|
||||
fs::{self, Directory},
|
||||
Branch,
|
||||
Repository,
|
||||
Branch, Repository,
|
||||
};
|
||||
|
||||
use super::GIT_PLATINUM;
|
||||
|
||||
@@ -2,23 +2,10 @@ use pretty_assertions::assert_eq;
|
||||
use radicle_git_ext::{ref_format::refname, Oid};
|
||||
use radicle_surf::{
|
||||
diff::{
|
||||
Added,
|
||||
Diff,
|
||||
DiffContent,
|
||||
DiffFile,
|
||||
EofNewLine,
|
||||
FileDiff,
|
||||
FileMode,
|
||||
FileStats,
|
||||
Hunk,
|
||||
Line,
|
||||
Modification,
|
||||
Modified,
|
||||
Stats,
|
||||
Added, Diff, DiffContent, DiffFile, EofNewLine, FileDiff, FileMode, FileStats, Hunk, Line,
|
||||
Modification, Modified, Stats,
|
||||
},
|
||||
Branch,
|
||||
Error,
|
||||
Repository,
|
||||
Branch, Error, Repository,
|
||||
};
|
||||
use std::{path::Path, str::FromStr};
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ mod directory {
|
||||
use radicle_git_ext::ref_format::refname;
|
||||
use radicle_surf::{
|
||||
fs::{self, Entry},
|
||||
Branch,
|
||||
Repository,
|
||||
Branch, Repository,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user