mirror of
https://github.com/Byron/gitoxide
synced 2025-10-06 01:52:40 +02:00
Drop trailing ,
just before )
on same line in function calls
These appear unintentional, and in most cases may have been introduced before rustfmt collapsed the lines, or with the idea that they would cause rustfmt to expand the lines but where that did not occur, or in an earlier version of the code where the last argument was longer and thus split onto another line. This does not remove a trailing `,` after the same argument when the argument is on its own line. Although this does remove trailing `,` in some macro calls (e.g., `format!`), this of course avoids making such changes in macro definitions, where `,)` is semantic.
This commit is contained in:
@@ -117,7 +117,7 @@ fn exclamation_marks_must_be_escaped_or_error_unlike_gitignore() {
|
||||
|
||||
#[test]
|
||||
fn invalid_escapes_in_quotes_are_an_error() {
|
||||
assert!(matches!(try_line(r#""\!hello""#), Err(parse::Error::Unquote(_)),),);
|
||||
assert!(matches!(try_line(r#""\!hello""#), Err(parse::Error::Unquote(_))));
|
||||
assert!(lenient_lines(r#""\!hello""#).is_empty());
|
||||
}
|
||||
|
||||
|
@@ -87,7 +87,7 @@ fn get_value_for_all_provided_values() -> crate::Result {
|
||||
&[cow_str("")],
|
||||
"unset values show up as empty within a string array"
|
||||
);
|
||||
assert_eq!(config.strings("core.bool-implicit").expect("present"), &[cow_str("")],);
|
||||
assert_eq!(config.strings("core.bool-implicit").expect("present"), &[cow_str("")]);
|
||||
|
||||
assert_eq!(config.string("doesn't.exist"), None);
|
||||
|
||||
|
@@ -44,7 +44,7 @@ fn from_git_dir() -> crate::Result {
|
||||
"value",
|
||||
"a value from the local repo configuration"
|
||||
);
|
||||
assert_eq!(config.string("a.local").expect("present").as_ref(), "value",);
|
||||
assert_eq!(config.string("a.local").expect("present").as_ref(), "value");
|
||||
assert_eq!(
|
||||
config.string_by("a", None, "local-include").expect("present").as_ref(),
|
||||
"from-a.config",
|
||||
|
@@ -21,7 +21,7 @@ fn valid_and_invalid() {
|
||||
assert_eq!(key.value_name, "baz");
|
||||
|
||||
let key = r"includeIf.gitdir/i:C:\bare.git.path".as_key();
|
||||
assert_eq!(key.subsection_name, Some(r"gitdir/i:C:\bare.git".into()),);
|
||||
assert_eq!(key.subsection_name, Some(r"gitdir/i:C:\bare.git".into()));
|
||||
}
|
||||
|
||||
mod _ref {
|
||||
|
@@ -43,7 +43,7 @@ fn git_config_no_system() {
|
||||
_ => unreachable!("known set"),
|
||||
}
|
||||
})
|
||||
.is_some(),);
|
||||
.is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@@ -49,7 +49,7 @@ fn quotes_right_next_to_each_other() {
|
||||
#[test]
|
||||
fn escaped_quotes_are_kept() {
|
||||
let cow = normalize_bstr(r#""hello \"\" world""#);
|
||||
assert_eq!(cow, cow_str("hello \"\" world").clone(),);
|
||||
assert_eq!(cow, cow_str("hello \"\" world").clone());
|
||||
assert!(matches!(cow, Cow::Owned(_)));
|
||||
}
|
||||
|
||||
|
@@ -312,7 +312,7 @@ fn renames_by_similarity_with_limit() -> crate::Result {
|
||||
"fuzzy tracking is effectively disabled due to limit"
|
||||
);
|
||||
let actual: Vec<_> = changes.iter().map(|c| c.fields().0).collect();
|
||||
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"],);
|
||||
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"]);
|
||||
|
||||
let out = out.expect("tracking enabled");
|
||||
assert_eq!(out.num_similarity_checks, 0);
|
||||
|
@@ -422,7 +422,7 @@ fn renames_by_similarity_with_limit() -> crate::Result {
|
||||
"fuzzy tracking is effectively disabled due to limit"
|
||||
);
|
||||
let actual: Vec<_> = changes.iter().map(Change::location).collect();
|
||||
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"],);
|
||||
assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"]);
|
||||
|
||||
let out = out.expect("tracking enabled");
|
||||
assert_eq!(out.num_similarity_checks, 0);
|
||||
|
@@ -2166,8 +2166,8 @@ fn untracked_and_ignored_collapse_handling_for_deletion_with_wildcards() -> crat
|
||||
entryps("c.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("d/a.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("d/b.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("d/d/a.o", Ignored(Expendable), File, WildcardMatch,),
|
||||
entryps("d/d/b.o", Ignored(Expendable), File, WildcardMatch,),
|
||||
entryps("d/d/a.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("d/d/b.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("generated/a.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("objs", Ignored(Expendable), Directory, WildcardMatch),
|
||||
],
|
||||
@@ -2213,7 +2213,7 @@ fn untracked_and_ignored_collapse_handling_for_deletion_with_wildcards() -> crat
|
||||
entryps("c.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("d/a.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("d/b.o", Ignored(Expendable), File, WildcardMatch),
|
||||
entryps("d/d", Untracked, Directory, WildcardMatch,),
|
||||
entryps("d/d", Untracked, Directory, WildcardMatch),
|
||||
entryps_dirstat("d/d/a.o", Ignored(Expendable), File, WildcardMatch, Untracked),
|
||||
entryps_dirstat("d/d/b.o", Ignored(Expendable), File, WildcardMatch, Untracked),
|
||||
entryps_dirstat(
|
||||
|
@@ -98,7 +98,7 @@ fn from_working_dir_no_config() -> crate::Result {
|
||||
for name in ["worktree-no-config-after-init", "worktree-no-config"] {
|
||||
let dir = repo_path()?.join(name);
|
||||
let (path, trust) = gix_discover::upwards(&dir)?;
|
||||
assert_eq!(path.kind(), Kind::WorkTree { linked_git_dir: None },);
|
||||
assert_eq!(path.kind(), Kind::WorkTree { linked_git_dir: None });
|
||||
assert_eq!(path.as_ref(), dir, "a working tree dir yields the git dir");
|
||||
assert_eq!(trust, expected_trust());
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ mod matches {
|
||||
);
|
||||
stat2.ctime.secs = 1;
|
||||
assert!(
|
||||
stat1.matches(&stat2, Options::default(),),
|
||||
stat1.matches(&stat2, Options::default()),
|
||||
"ctime seconds are the same so stat matches (trust_ctime=true,use_nsec=false)"
|
||||
);
|
||||
assert!(
|
||||
|
@@ -56,7 +56,7 @@ mod from_state {
|
||||
index.write(gix_index::write::Options::default())?;
|
||||
assert!(index.checksum().is_some(), "checksum is adjusted after writing");
|
||||
assert!(index.path().is_file());
|
||||
assert_eq!(index.version(), expected_version,);
|
||||
assert_eq!(index.version(), expected_version);
|
||||
|
||||
index.verify_integrity()?;
|
||||
}
|
||||
|
@@ -261,7 +261,7 @@ fn compare_states(actual: &State, actual_version: Version, expected: &State, opt
|
||||
expected.entries().len(),
|
||||
"entry count mismatch in {fixture:?}",
|
||||
);
|
||||
assert_eq!(actual.entries(), expected.entries(), "entries mismatch in {fixture:?}",);
|
||||
assert_eq!(actual.entries(), expected.entries(), "entries mismatch in {fixture:?}");
|
||||
assert_eq!(
|
||||
actual.path_backing(),
|
||||
expected.path_backing(),
|
||||
|
@@ -78,7 +78,7 @@ pub fn unique_path_in_tree(
|
||||
let mut suffix = 0;
|
||||
while editor.get(to_components_bstring_ref(&buf)).is_some() || tree.check_conflict(buf.as_bstr()).is_some() {
|
||||
buf.truncate(base_len);
|
||||
buf.push_str(format!("_{suffix}",));
|
||||
buf.push_str(format!("_{suffix}"));
|
||||
suffix += 1;
|
||||
}
|
||||
Ok(buf)
|
||||
|
@@ -161,7 +161,7 @@ mod text {
|
||||
num_diverging += 1;
|
||||
} else {
|
||||
if case.expected.contains_str("<<<<<<<") {
|
||||
assert_eq!(actual, Resolution::Conflict, "{}: resolution mismatch", case.name,);
|
||||
assert_eq!(actual, Resolution::Conflict, "{}: resolution mismatch", case.name);
|
||||
} else {
|
||||
assert!(
|
||||
matches!(
|
||||
|
@@ -463,7 +463,7 @@ theirs
|
||||
|
||||
let mut input = imara_diff::intern::InternedInput::new(&[][..], &[]);
|
||||
assert_eq!(
|
||||
platform_ref.builtin_merge(BuiltinDriver::Text, &mut out, &mut input, Default::default(),),
|
||||
platform_ref.builtin_merge(BuiltinDriver::Text, &mut out, &mut input, Default::default()),
|
||||
res,
|
||||
"we can't enforce it, it will just default to using binary"
|
||||
);
|
||||
@@ -689,7 +689,7 @@ mod prepare_merge {
|
||||
},
|
||||
)?;
|
||||
let expected_idx = 1;
|
||||
assert_eq!(prepared.driver, DriverChoice::Index(expected_idx),);
|
||||
assert_eq!(prepared.driver, DriverChoice::Index(expected_idx));
|
||||
assert_eq!(
|
||||
prepared.options.resolve_binary_with,
|
||||
Some(builtin_driver::binary::ResolveWith::Ours),
|
||||
|
@@ -56,7 +56,7 @@ fn compress_data(obj: &gix_object::Data<'_>) -> Result<Vec<u8>, input::Error> {
|
||||
match err.kind() {
|
||||
std::io::ErrorKind::Other => return Err(input::Error::Io(err)),
|
||||
err => {
|
||||
unreachable!("Should never see other errors than zlib, but got {:?}", err,)
|
||||
unreachable!("Should never see other errors than zlib, but got {:?}", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -142,7 +142,7 @@ impl output::Entry {
|
||||
if let Err(err) = std::io::copy(&mut &*obj.data, &mut out) {
|
||||
match err.kind() {
|
||||
std::io::ErrorKind::Other => return Err(Error::ZlibDeflate(err)),
|
||||
err => unreachable!("Should never see other errors than zlib, but got {:?}", err,),
|
||||
err => unreachable!("Should never see other errors than zlib, but got {:?}", err),
|
||||
}
|
||||
}
|
||||
out.flush()?;
|
||||
|
@@ -17,11 +17,11 @@ mod reference {
|
||||
#[test]
|
||||
fn invalid() {
|
||||
assert!(decode::reference::<()>
|
||||
.parse_peek(b"# what looks like a comment",)
|
||||
.parse_peek(b"# what looks like a comment")
|
||||
.is_err());
|
||||
assert!(
|
||||
decode::reference::<()>
|
||||
.parse_peek(b"^e9cdc958e7ce2290e2d7958cdb5aa9323ef35d37\n",)
|
||||
.parse_peek(b"^e9cdc958e7ce2290e2d7958cdb5aa9323ef35d37\n")
|
||||
.is_err(),
|
||||
"lonely peel"
|
||||
);
|
||||
|
@@ -73,14 +73,14 @@ mod with_namespace {
|
||||
);
|
||||
assert_eq!(
|
||||
store
|
||||
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr(),)?
|
||||
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr())?
|
||||
.name,
|
||||
fullname,
|
||||
"it will find namespaced items just by their shortened (but not shortest) name"
|
||||
);
|
||||
assert!(
|
||||
store
|
||||
.try_find(reference.name_without_namespace(&ns_two).expect("namespaced"),)?
|
||||
.try_find(reference.name_without_namespace(&ns_two).expect("namespaced"))?
|
||||
.is_none(),
|
||||
"it won't find namespaced items by their full name without namespace"
|
||||
);
|
||||
@@ -167,7 +167,7 @@ mod with_namespace {
|
||||
|
||||
for fullname in ref_names {
|
||||
assert_eq!(
|
||||
ns_store.find(fullname.as_bstr(),)?.name,
|
||||
ns_store.find(fullname.as_bstr())?.name,
|
||||
fullname,
|
||||
"it finds namespaced items by fully qualified name, excluding namespace"
|
||||
);
|
||||
@@ -179,7 +179,7 @@ mod with_namespace {
|
||||
);
|
||||
assert_eq!(
|
||||
ns_store
|
||||
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr(),)?
|
||||
.find(fullname.as_bstr().splitn_str(2, b"/").nth(1).expect("name").as_bstr())?
|
||||
.name,
|
||||
fullname,
|
||||
"it finds partial names within the namespace"
|
||||
@@ -372,7 +372,7 @@ fn loose_iter_with_partial_prefix() -> crate::Result {
|
||||
|
||||
assert_eq!(
|
||||
actual,
|
||||
vec!["refs/heads/d1", "refs/heads/dt1",]
|
||||
vec!["refs/heads/d1", "refs/heads/dt1"]
|
||||
.into_iter()
|
||||
.map(String::from)
|
||||
.collect::<Vec<_>>(),
|
||||
|
@@ -683,7 +683,7 @@ fn write_reference_to_which_head_points_to_does_not_update_heads_reflog_even_tho
|
||||
},
|
||||
expected: PreviousValue::MustExistAndMatch(Target::Object(hex_to_id(
|
||||
"02a7a22d90d7c02fb494ed25551850b868e634f0"
|
||||
)),),
|
||||
))),
|
||||
new: Target::Object(new_id),
|
||||
},
|
||||
name: referent.as_bstr().try_into()?,
|
||||
|
@@ -414,7 +414,7 @@ fn a_loose_ref_with_old_value_check_and_outdated_packed_refs_value_deletes_both_
|
||||
"only one edit even though technically two places were changed"
|
||||
);
|
||||
assert!(
|
||||
store.try_find("newer-as-loose",)?.is_none(),
|
||||
store.try_find("newer-as-loose")?.is_none(),
|
||||
"reference is deleted everywhere"
|
||||
);
|
||||
Ok(())
|
||||
|
@@ -598,7 +598,7 @@ mod writable {
|
||||
{
|
||||
let unprefixed_name = "refs/heads/new";
|
||||
let reference = store.find(unprefixed_name)?;
|
||||
assert_eq!(reference.target.id(), new_id_main,);
|
||||
assert_eq!(reference.target.id(), new_id_main);
|
||||
assert_eq!(
|
||||
reflog_for_name(&store, reference.name.as_ref(), &mut buf),
|
||||
vec![new_id_main.to_string()]
|
||||
|
@@ -168,7 +168,7 @@ pub mod baseline {
|
||||
fixes: expected_fixes,
|
||||
} => {
|
||||
let (actual, actual_fixes) = actual.unwrap();
|
||||
assert_eq!(&actual_fixes, expected_fixes,);
|
||||
assert_eq!(&actual_fixes, expected_fixes);
|
||||
(actual.mappings, expected)
|
||||
}
|
||||
};
|
||||
|
@@ -187,7 +187,7 @@ fn typical_usecases() -> crate::Result {
|
||||
},
|
||||
|res, id| {
|
||||
let res = res?.expect("candidate found");
|
||||
assert_eq!(res.name, Some(name.clone()),);
|
||||
assert_eq!(res.name, Some(name.clone()));
|
||||
assert_eq!(res.id, id);
|
||||
assert_eq!(res.depth, 1);
|
||||
assert_eq!(res.commits_seen, 2);
|
||||
@@ -236,7 +236,7 @@ fn shallow_yields_result_if_refs_are_available() -> crate::Result {
|
||||
},
|
||||
|res, id| {
|
||||
let res = res?.expect("found candidate");
|
||||
assert_eq!(res.name, Some(name.clone()),);
|
||||
assert_eq!(res.name, Some(name.clone()));
|
||||
assert_eq!(res.id, id);
|
||||
assert_eq!(res.depth, 1);
|
||||
assert_eq!(res.commits_seen, 2);
|
||||
|
@@ -23,7 +23,7 @@ fn reflog_by_entry_for_current_branch() {
|
||||
let rec = parse(spec);
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.find_ref[0], None,);
|
||||
assert_eq!(rec.find_ref[0], None);
|
||||
assert_eq!(
|
||||
rec.prefix[0], None,
|
||||
"neither ref nor prefixes are set, straight to navigation"
|
||||
@@ -38,7 +38,7 @@ fn reflog_by_date_for_current_branch() {
|
||||
let rec = parse("@{1979-02-26 18:30:00}");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.find_ref[0], None,);
|
||||
assert_eq!(rec.find_ref[0], None);
|
||||
assert_eq!(
|
||||
rec.prefix[0], None,
|
||||
"neither ref nor prefixes are set, straight to navigation"
|
||||
@@ -52,7 +52,7 @@ fn reflog_by_unix_timestamp_for_current_branch() {
|
||||
let rec = parse("@{100000000}");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.find_ref[0], None,);
|
||||
assert_eq!(rec.find_ref[0], None);
|
||||
assert_eq!(
|
||||
rec.prefix[0], None,
|
||||
"neither ref nor prefixes are set, straight to navigation"
|
||||
@@ -104,7 +104,7 @@ fn reflog_by_date_for_given_ref_name() {
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), expected_ref);
|
||||
assert_eq!(rec.prefix[0], None,);
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.current_branch_reflog_entry[0], Some("42 +0030".to_string()));
|
||||
assert_eq!(rec.calls, 2, "first the ref, then the reflog entry");
|
||||
}
|
||||
@@ -121,7 +121,7 @@ fn reflog_by_entry_for_given_ref_name() {
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), expected_ref);
|
||||
assert_eq!(rec.prefix[0], None,);
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.current_branch_reflog_entry[0], Some(expected_entry.to_string()));
|
||||
assert_eq!(rec.calls, 2, "first the ref, then the reflog entry");
|
||||
}
|
||||
@@ -162,7 +162,7 @@ fn sibling_branch_for_branch_name() {
|
||||
let rec = parse(spec);
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), ref_name,);
|
||||
assert_eq!(rec.get_ref(0), ref_name);
|
||||
assert_eq!(rec.prefix[0], None, "neither ref nor prefix are explicitly set");
|
||||
assert_eq!(
|
||||
rec.sibling_branch[0].as_deref(),
|
||||
@@ -200,7 +200,7 @@ fn nth_checked_out_branch() {
|
||||
let rec = parse(spec);
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.find_ref[0], None,);
|
||||
assert_eq!(rec.find_ref[0], None);
|
||||
assert_eq!(
|
||||
rec.prefix[0], None,
|
||||
"neither ref nor prefixes are set, straight to navigation"
|
||||
|
@@ -81,7 +81,7 @@ fn full_format_with_dirty_suffix_is_recognized() {
|
||||
let rec = parse("cargo-smart-release-679-g3bee7fb-dirty");
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.find_ref[0], None, "git does not see this as prefix, we do");
|
||||
assert_eq!(rec.prefix[0], Some(gix_hash::Prefix::from_hex("3bee7fb").unwrap()),);
|
||||
assert_eq!(rec.prefix[0], Some(gix_hash::Prefix::from_hex("3bee7fb").unwrap()));
|
||||
assert_eq!(rec.prefix_hint[0], anchor_hint());
|
||||
assert_eq!(rec.calls, 1);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ fn partial_format_with_dirty_suffix_is_recognized() {
|
||||
let spec = "abcdef1-dirty";
|
||||
let rec = parse(spec);
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.find_ref[0], None,);
|
||||
assert_eq!(rec.find_ref[0], None);
|
||||
assert_eq!(
|
||||
rec.prefix[0],
|
||||
Some(gix_hash::Prefix::from_hex("abcdef1").unwrap()),
|
||||
@@ -110,7 +110,7 @@ fn partial_format_lookalikes_are_never_considered() {
|
||||
let rec = parse(spec);
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), spec);
|
||||
assert_eq!(rec.prefix[0], None,);
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.calls, 1, "we don't even try the prefix");
|
||||
}
|
||||
|
||||
@@ -127,6 +127,6 @@ fn partial_format_with_dirty_suffix_lookalikes_are_treated_as_refs() {
|
||||
.unwrap();
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), spec);
|
||||
assert_eq!(rec.prefix[0], None,);
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.calls, 2);
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ fn single_is_first_parent() {
|
||||
let rec = parse("@^");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), "HEAD",);
|
||||
assert_eq!(rec.get_ref(0), "HEAD");
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.traversal[0], Traversal::NthParent(1));
|
||||
assert_eq!(rec.calls, 2);
|
||||
@@ -18,7 +18,7 @@ fn multiple_calls_stack() {
|
||||
let rec = parse("@^^^10^0^{tag}^020");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), "HEAD",);
|
||||
assert_eq!(rec.get_ref(0), "HEAD");
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(
|
||||
rec.traversal,
|
||||
@@ -44,7 +44,7 @@ fn followed_by_zero_is_peeling_to_commit() {
|
||||
let rec = parse("@^0");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), "HEAD",);
|
||||
assert_eq!(rec.get_ref(0), "HEAD");
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.traversal.len(), 0, "traversals by parent are never zero");
|
||||
assert_eq!(
|
||||
|
@@ -13,7 +13,7 @@ fn single_is_first_ancestor() {
|
||||
let rec = parse("@~");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), "HEAD",);
|
||||
assert_eq!(rec.get_ref(0), "HEAD");
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.traversal[0], Traversal::NthAncestor(1));
|
||||
assert_eq!(rec.calls, 2);
|
||||
@@ -24,7 +24,7 @@ fn followed_by_zero_is_no_op() {
|
||||
let rec = parse("@~0");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), "HEAD",);
|
||||
assert_eq!(rec.get_ref(0), "HEAD");
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(rec.calls, 1);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ fn multiple_calls_stack() {
|
||||
let rec = parse("@~~~10~0~020");
|
||||
|
||||
assert!(rec.kind.is_none());
|
||||
assert_eq!(rec.get_ref(0), "HEAD",);
|
||||
assert_eq!(rec.get_ref(0), "HEAD");
|
||||
assert_eq!(rec.prefix[0], None);
|
||||
assert_eq!(
|
||||
rec.traversal,
|
||||
|
@@ -579,7 +579,7 @@ fn unchanged_despite_filter() {
|
||||
symlink_metadata_calls: 5,
|
||||
..Default::default()
|
||||
};
|
||||
assert_eq!(actual_outcome, expected_outcome,);
|
||||
assert_eq!(actual_outcome, expected_outcome);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -754,7 +754,7 @@ fn modified() {
|
||||
),
|
||||
],
|
||||
);
|
||||
assert_eq!(actual_outcome, expected_outcome,);
|
||||
assert_eq!(actual_outcome, expected_outcome);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@@ -123,7 +123,7 @@ fn http_will_use_pipelining() {
|
||||
}
|
||||
});
|
||||
|
||||
let url = format!("http://{}:{}/reponame", &addr.ip().to_string(), &addr.port(),);
|
||||
let url = format!("http://{}:{}/reponame", &addr.ip().to_string(), &addr.port());
|
||||
let mut client =
|
||||
gix_transport::client::http::connect(url.try_into().expect("valid url"), gix_transport::Protocol::V2, false);
|
||||
match client.handshake(gix_transport::Service::UploadPack, &[]) {
|
||||
|
@@ -778,7 +778,7 @@ mod update {
|
||||
}
|
||||
_ => unreachable!("only updates"),
|
||||
}
|
||||
assert_eq!(edit.name.as_bstr(), "refs/remotes/origin/new-HEAD",);
|
||||
assert_eq!(edit.name.as_bstr(), "refs/remotes/origin/new-HEAD");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@@ -463,12 +463,12 @@ mod core {
|
||||
#[test]
|
||||
fn log_all_ref_updates() -> crate::Result {
|
||||
assert_eq!(
|
||||
Core::LOG_ALL_REF_UPDATES.try_into_ref_updates(Some(Ok(true)),)?,
|
||||
Core::LOG_ALL_REF_UPDATES.try_into_ref_updates(Some(Ok(true)))?,
|
||||
Some(gix_ref::store::WriteReflog::Normal)
|
||||
);
|
||||
assert!(Core::LOG_ALL_REF_UPDATES.validate("true".into()).is_ok());
|
||||
assert_eq!(
|
||||
Core::LOG_ALL_REF_UPDATES.try_into_ref_updates(Some(Ok(false)),)?,
|
||||
Core::LOG_ALL_REF_UPDATES.try_into_ref_updates(Some(Ok(false)))?,
|
||||
Some(gix_ref::store::WriteReflog::Disable)
|
||||
);
|
||||
assert!(Core::LOG_ALL_REF_UPDATES.validate("0".into()).is_ok());
|
||||
|
@@ -131,7 +131,7 @@ mod find {
|
||||
|
||||
let obj = tag_ref.peel_to_kind(gix::object::Kind::Tree)?;
|
||||
assert!(obj.kind.is_tree());
|
||||
assert_eq!(obj.id, hex_to_id("4b825dc642cb6eb9a060e54bf8d69288fbee4904"),);
|
||||
assert_eq!(obj.id, hex_to_id("4b825dc642cb6eb9a060e54bf8d69288fbee4904"));
|
||||
assert_eq!(tag_ref.peel_to_tree()?.id, obj.id);
|
||||
|
||||
assert_eq!(
|
||||
|
@@ -67,7 +67,7 @@ mod http {
|
||||
assert_eq!(follow_redirects, FollowRedirects::All);
|
||||
assert_eq!(low_speed_limit_bytes_per_second, 5120);
|
||||
assert_eq!(low_speed_time_seconds, 10);
|
||||
assert_eq!(proxy.as_deref(), Some("http://localhost:9090"),);
|
||||
assert_eq!(proxy.as_deref(), Some("http://localhost:9090"));
|
||||
assert!(
|
||||
proxy_authenticate.is_none(),
|
||||
"no username means no authentication required"
|
||||
|
@@ -197,7 +197,7 @@ mod find_remote {
|
||||
let expected_push_url: BString = baseline.next().expect("push").into();
|
||||
|
||||
let remote = repo.find_remote("origin")?;
|
||||
assert_eq!(remote.url(Direction::Fetch).unwrap().to_bstring(), expected_fetch_url,);
|
||||
assert_eq!(remote.url(Direction::Fetch).unwrap().to_bstring(), expected_fetch_url);
|
||||
{
|
||||
let actual_push_url = remote.url(Direction::Push).unwrap().to_bstring();
|
||||
assert_ne!(
|
||||
|
@@ -39,7 +39,7 @@ fn freestanding_double_or_triple_dot_defaults_to_head_refs() -> crate::Result {
|
||||
parse_spec_no_baseline("..", &repo)?, // git can't communicate what it does here
|
||||
parse_spec("@..@", &repo)?,
|
||||
);
|
||||
assert_eq!(parse_spec("...", &repo)?, parse_spec("@...@", &repo)?,);
|
||||
assert_eq!(parse_spec("...", &repo)?, parse_spec("@...@", &repo)?);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ fn parent() {
|
||||
parse_spec("a^1", &repo).unwrap(),
|
||||
Spec::from_id(hex_to_id("5b3f9e24965d0b28780b7ce5daf2b5b7f7e0459f").attach(&repo))
|
||||
);
|
||||
assert_eq!(parse_spec("a", &repo).unwrap(), parse_spec("a^0", &repo).unwrap(),);
|
||||
assert_eq!(parse_spec("a", &repo).unwrap(), parse_spec("a^0", &repo).unwrap());
|
||||
assert_eq!(
|
||||
parse_spec("a^42", &repo).unwrap_err().to_string(),
|
||||
"Commit 55e825e has 2 parents and parent number 42 is out of range"
|
||||
@@ -64,7 +64,7 @@ fn ancestors() {
|
||||
parse_spec("a~1", &repo).unwrap(),
|
||||
Spec::from_id(hex_to_id("5b3f9e24965d0b28780b7ce5daf2b5b7f7e0459f").attach(&repo))
|
||||
);
|
||||
assert_eq!(parse_spec("a", &repo).unwrap(), parse_spec("a~0", &repo).unwrap(),);
|
||||
assert_eq!(parse_spec("a", &repo).unwrap(), parse_spec("a~0", &repo).unwrap());
|
||||
assert_eq!(
|
||||
parse_spec("a~3", &repo).unwrap(),
|
||||
Spec::from_id(hex_to_id("9f9eac6bd1cd4b4cc6a494f044b28c985a22972b").attach(&repo))
|
||||
|
Reference in New Issue
Block a user