Skip to content

Commit

Permalink
declare reflog access by date to be planned. (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 3, 2022
1 parent 145631b commit 95bcf3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
12 changes: 10 additions & 2 deletions git-repository/src/revision/spec/parse/delegate.rs
Expand Up @@ -271,9 +271,17 @@ impl<'repo> delegate::Revision for Delegate<'repo> {
}
}

fn reflog(&mut self, _query: ReflogLookup) -> Option<()> {
fn reflog(&mut self, query: ReflogLookup) -> Option<()> {
self.unset_disambiguate_call();
todo!()
match query {
ReflogLookup::Date(_date) => {
self.err.push(Error::Planned {
dependency: "remote handling and ref-specs are fleshed out more",
});
None
}
ReflogLookup::Entry(_no) => todo!("entry lookup"),
}
}

fn nth_checked_out_branch(&mut self, branch_no: usize) -> Option<()> {
Expand Down
12 changes: 11 additions & 1 deletion git-repository/tests/revision/spec/from_bytes/reflog.rs
@@ -1,4 +1,5 @@
use crate::revision::spec::from_bytes::{parse_spec, repo};
use crate::revision::spec::from_bytes::{parse_spec, parse_spec_no_baseline, repo};
use git_repository::revision::spec::parse::Error;

#[test]
fn nth_prior_checkout() {
Expand All @@ -20,3 +21,12 @@ fn nth_prior_checkout() {
"HEAD has 5 prior checkouts and checkout number 6 is out of range"
);
}

#[test]
fn by_date() {
let repo = repo("complex_graph").unwrap();
assert!(matches!(
parse_spec_no_baseline("main@{1979-02-26 18:30:00}", &repo).unwrap_err(),
Error::Planned { .. }
));
}

0 comments on commit 95bcf3b

Please sign in to comment.