Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support annotated tags when using --squash #1104

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/bin/josh-filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ fn run_filter(args: Vec<String>) -> josh::JoshResult<i32> {
let pattern = pattern.to_string();
for reference in repo.references_glob(&pattern).unwrap() {
let reference = reference?;
if let Some(target) = reference.target() {
ids.push((target, reference.name().unwrap().to_string()));
refs.push((reference.name().unwrap().to_string(), target));
}
let target = reference.peel_to_commit()?.id();
ids.push((target, reference.name().unwrap().to_string()));
refs.push((reference.name().unwrap().to_string(), target));
}
filterobj = josh::filter::chain(josh::filter::squash(Some(&ids)), filterobj);
};
Expand Down
4 changes: 3 additions & 1 deletion tests/filter/squash.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[128]
$ git tag tag_a 1d69b7d

This one tag is an annotated tag, to make sure those are handled as well
$ git tag -a tag_a -m "created a tag" 1d69b7d
$ josh-filter -s --squash "refs/tags/*" :author=\"New\ Author\"\;\"new@e.mail\" --update refs/heads/filtered
[1] :author="New Author";"new@e.mail"
[1] :squash(
Expand Down