diff --git a/josh-core/src/cache.rs b/josh-core/src/cache.rs index 5995a9657..fdab54a01 100644 --- a/josh-core/src/cache.rs +++ b/josh-core/src/cache.rs @@ -1,7 +1,7 @@ use super::*; use std::collections::HashMap; -const CACHE_VERSION: u64 = 22; +const CACHE_VERSION: u64 = 23; lazy_static! { static ref DB: std::sync::Mutex> = std::sync::Mutex::new(None); diff --git a/josh-core/src/filter/mod.rs b/josh-core/src/filter/mod.rs index fc16344a1..c73738c54 100644 --- a/josh-core/src/filter/mod.rs +++ b/josh-core/src/filter/mod.rs @@ -816,7 +816,7 @@ fn apply_to_commit2( Op::Prune => { let p: Vec<_> = commit.parent_ids().collect(); - if p.len() > 0 { + if p.len() > 1 { let parent = some_or!(transaction.get(filter, p[0]), { return Ok(None); }); diff --git a/tests/filter/prune_trivial_merge.t b/tests/filter/prune_trivial_merge.t index 081b80853..d52ca62ca 100644 --- a/tests/filter/prune_trivial_merge.t +++ b/tests/filter/prune_trivial_merge.t @@ -21,27 +21,36 @@ $ git add . $ git commit -m "mod file1" 1> /dev/null + $ git commit --allow-empty -m "empty commit" 1> /dev/null + $ git merge -q branch1 --no-ff $ git log --graph --pretty=%s * Merge branch 'branch1' |\ | * add file2 + * | empty commit * | mod file1 |/ * add file1 $ josh-filter -s ::file1 - [3] ::file1 + [4] ::file1 $ git log --graph --pretty=%s FILTERED_HEAD * Merge branch 'branch1' |\ + * | empty commit * | mod file1 |/ * add file1 $ josh-filter -s ::file1:prune=trivial-merge - [2] :prune=trivial-merge - [3] ::file1 + [3] :prune=trivial-merge + [4] ::file1 $ git log --graph --pretty=%s FILTERED_HEAD + * empty commit * mod file1 * add file1 + + + + diff --git a/tests/proxy/amend_patchset.t b/tests/proxy/amend_patchset.t index 34f652f21..366e2e3e7 100644 --- a/tests/proxy/amend_patchset.t +++ b/tests/proxy/amend_patchset.t @@ -124,7 +124,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/authentication.t b/tests/proxy/authentication.t index dc07a771a..676a65dac 100644 --- a/tests/proxy/authentication.t +++ b/tests/proxy/authentication.t @@ -124,7 +124,7 @@ "real_repo.git" = ["::sub1/"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/caching.t b/tests/proxy/caching.t index 667cc0b8c..0cf43748a 100644 --- a/tests/proxy/caching.t +++ b/tests/proxy/caching.t @@ -51,7 +51,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf @@ -162,7 +162,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_absent_head.t b/tests/proxy/clone_absent_head.t index ae870dc4a..d812f8828 100644 --- a/tests/proxy/clone_absent_head.t +++ b/tests/proxy/clone_absent_head.t @@ -85,7 +85,7 @@ $ bash ${TESTDIR}/destroy_test_env.sh . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_all.t b/tests/proxy/clone_all.t index 1bdbaa616..f4e6a25fa 100644 --- a/tests/proxy/clone_all.t +++ b/tests/proxy/clone_all.t @@ -53,7 +53,7 @@ "real_repo.git" = ["::sub1/"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_blocked.t b/tests/proxy/clone_blocked.t index cdd673d6e..f26a894d6 100644 --- a/tests/proxy/clone_blocked.t +++ b/tests/proxy/clone_blocked.t @@ -9,7 +9,7 @@ $ bash ${TESTDIR}/destroy_test_env.sh . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_invalid_url.t b/tests/proxy/clone_invalid_url.t index aed543f67..e3a379686 100644 --- a/tests/proxy/clone_invalid_url.t +++ b/tests/proxy/clone_invalid_url.t @@ -32,7 +32,7 @@ $ bash ${TESTDIR}/destroy_test_env.sh . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_locked_refs.t b/tests/proxy/clone_locked_refs.t index b2ebb2d13..5f8db7e8e 100644 --- a/tests/proxy/clone_locked_refs.t +++ b/tests/proxy/clone_locked_refs.t @@ -111,7 +111,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_prefix.t b/tests/proxy/clone_prefix.t index 6c1d73d04..54be4f3b0 100644 --- a/tests/proxy/clone_prefix.t +++ b/tests/proxy/clone_prefix.t @@ -74,7 +74,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_sha.t b/tests/proxy/clone_sha.t index 55a9cd504..19eac1ee7 100644 --- a/tests/proxy/clone_sha.t +++ b/tests/proxy/clone_sha.t @@ -93,7 +93,7 @@ Check (2) and (3) but with a branch ref "real_repo.git" = ["::sub1/"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_subsubtree.t b/tests/proxy/clone_subsubtree.t index 7267167d2..230cddc32 100644 --- a/tests/proxy/clone_subsubtree.t +++ b/tests/proxy/clone_subsubtree.t @@ -87,7 +87,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_subtree.t b/tests/proxy/clone_subtree.t index 1a44d7e07..daac370ba 100644 --- a/tests/proxy/clone_subtree.t +++ b/tests/proxy/clone_subtree.t @@ -85,7 +85,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_subtree_no_master.t b/tests/proxy/clone_subtree_no_master.t index 4f2aecaba..e539165f4 100644 --- a/tests/proxy/clone_subtree_no_master.t +++ b/tests/proxy/clone_subtree_no_master.t @@ -78,7 +78,7 @@ "real_repo.git" = [":/sub1"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_subtree_tags.t b/tests/proxy/clone_subtree_tags.t index a38246776..82f5bb53d 100644 --- a/tests/proxy/clone_subtree_tags.t +++ b/tests/proxy/clone_subtree_tags.t @@ -117,7 +117,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/clone_with_meta.t b/tests/proxy/clone_with_meta.t index 9840c1404..c3a88aa54 100644 --- a/tests/proxy/clone_with_meta.t +++ b/tests/proxy/clone_with_meta.t @@ -129,7 +129,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/empty_commit.t b/tests/proxy/empty_commit.t index b70c6efc1..f5c455fa4 100644 --- a/tests/proxy/empty_commit.t +++ b/tests/proxy/empty_commit.t @@ -83,7 +83,7 @@ should still be included. "real_repo.git" = ["::sub1/"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/get_version.t b/tests/proxy/get_version.t index a29fb043a..1fedb9117 100644 --- a/tests/proxy/get_version.t +++ b/tests/proxy/get_version.t @@ -7,7 +7,7 @@ $ bash ${TESTDIR}/destroy_test_env.sh . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/import_export.t b/tests/proxy/import_export.t index 3282bedfa..ebfeeeb9c 100644 --- a/tests/proxy/import_export.t +++ b/tests/proxy/import_export.t @@ -301,7 +301,7 @@ Flushed credential cache "repo2.git" = [":prefix=repo2"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/join_subtree.t b/tests/proxy/join_subtree.t index 8153f9f44..2a608910b 100644 --- a/tests/proxy/join_subtree.t +++ b/tests/proxy/join_subtree.t @@ -132,7 +132,7 @@ Make sure all temporary namespace got removed ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/join_with_merge.t b/tests/proxy/join_with_merge.t index 91af27b09..f5c491916 100644 --- a/tests/proxy/join_with_merge.t +++ b/tests/proxy/join_with_merge.t @@ -59,7 +59,7 @@ "real_repo.git" = [":prefix=sub1"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/markers.t b/tests/proxy/markers.t index bdf0e8c7b..100470e47 100644 --- a/tests/proxy/markers.t +++ b/tests/proxy/markers.t @@ -340,7 +340,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/no_proxy.t b/tests/proxy/no_proxy.t index 881552ec2..d5fb945b4 100644 --- a/tests/proxy/no_proxy.t +++ b/tests/proxy/no_proxy.t @@ -35,7 +35,7 @@ $ bash ${TESTDIR}/destroy_test_env.sh . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/no_proxy_lfs.t b/tests/proxy/no_proxy_lfs.t index 23ea90fa3..e9594b371 100644 --- a/tests/proxy/no_proxy_lfs.t +++ b/tests/proxy/no_proxy_lfs.t @@ -50,7 +50,7 @@ $ bash ${TESTDIR}/destroy_test_env.sh . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_graphql.t b/tests/proxy/push_graphql.t index d51ac6794..958ca06e4 100644 --- a/tests/proxy/push_graphql.t +++ b/tests/proxy/push_graphql.t @@ -69,7 +69,7 @@ "real_repo.git" = ["::sub1/"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_new_branch.t b/tests/proxy/push_new_branch.t index 7b6907370..3b817304c 100644 --- a/tests/proxy/push_new_branch.t +++ b/tests/proxy/push_new_branch.t @@ -114,7 +114,7 @@ Check the branch again ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_prefix.t b/tests/proxy/push_prefix.t index 511030bda..6b2ddab0f 100644 --- a/tests/proxy/push_prefix.t +++ b/tests/proxy/push_prefix.t @@ -56,7 +56,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_review.t b/tests/proxy/push_review.t index 9804d7c68..fabe2535b 100644 --- a/tests/proxy/push_review.t +++ b/tests/proxy/push_review.t @@ -87,7 +87,7 @@ Make sure all temporary namespace got removed ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_review_already_in.t b/tests/proxy/push_review_already_in.t index 0938c9a8d..fd5076a36 100644 --- a/tests/proxy/push_review_already_in.t +++ b/tests/proxy/push_review_already_in.t @@ -48,7 +48,7 @@ test for that. "real_repo.git" = [] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_review_nop_behind.t b/tests/proxy/push_review_nop_behind.t index 2bec8616e..c7261dba8 100644 --- a/tests/proxy/push_review_nop_behind.t +++ b/tests/proxy/push_review_nop_behind.t @@ -55,7 +55,7 @@ This is a regression test for that problem. "real_repo.git" = [] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_review_old.t b/tests/proxy/push_review_old.t index 288acf3d4..2a044fe3e 100644 --- a/tests/proxy/push_review_old.t +++ b/tests/proxy/push_review_old.t @@ -85,7 +85,7 @@ Flushed credential cache ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_review_topic.t b/tests/proxy/push_review_topic.t index 35c4b0582..df867b691 100644 --- a/tests/proxy/push_review_topic.t +++ b/tests/proxy/push_review_topic.t @@ -42,7 +42,7 @@ Make sure all temporary namespace got removed ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_stacked.t b/tests/proxy/push_stacked.t index 2afe47e11..19409c8a7 100644 --- a/tests/proxy/push_stacked.t +++ b/tests/proxy/push_stacked.t @@ -151,7 +151,7 @@ Make sure all temporary namespace got removed ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_stacked_gerrit.t b/tests/proxy/push_stacked_gerrit.t index 7bc869381..2437bbca4 100644 --- a/tests/proxy/push_stacked_gerrit.t +++ b/tests/proxy/push_stacked_gerrit.t @@ -134,7 +134,7 @@ Make sure all temporary namespace got removed "real_repo.git" = ["::sub1/"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_stacked_split.t b/tests/proxy/push_stacked_split.t index 2d1cba25d..051c229f7 100644 --- a/tests/proxy/push_stacked_split.t +++ b/tests/proxy/push_stacked_split.t @@ -76,7 +76,7 @@ Make sure all temporary namespace got removed "real_repo.git" = ["::sub1/"] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_stacked_sub.t b/tests/proxy/push_stacked_sub.t index 09533913d..d916d741a 100644 --- a/tests/proxy/push_stacked_sub.t +++ b/tests/proxy/push_stacked_sub.t @@ -132,7 +132,7 @@ Make sure all temporary namespace got removed ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_subdir_prefix.t b/tests/proxy/push_subdir_prefix.t index 7ce961eeb..9a083378c 100644 --- a/tests/proxy/push_subdir_prefix.t +++ b/tests/proxy/push_subdir_prefix.t @@ -48,7 +48,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_subtree.t b/tests/proxy/push_subtree.t index ecd902827..fa40ee466 100644 --- a/tests/proxy/push_subtree.t +++ b/tests/proxy/push_subtree.t @@ -90,7 +90,7 @@ Make sure all temporary namespace got removed ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/push_subtree_two_repos.t b/tests/proxy/push_subtree_two_repos.t index 74ee8dd97..5faa07905 100644 --- a/tests/proxy/push_subtree_two_repos.t +++ b/tests/proxy/push_subtree_two_repos.t @@ -118,7 +118,7 @@ Put a double slash in the URL to see that it also works ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/unrelated_leak.t b/tests/proxy/unrelated_leak.t index d35466c50..cc73f66ba 100644 --- a/tests/proxy/unrelated_leak.t +++ b/tests/proxy/unrelated_leak.t @@ -133,7 +133,7 @@ Flushed credential cache ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace.t b/tests/proxy/workspace.t index 74d5ad470..1dabca1cd 100644 --- a/tests/proxy/workspace.t +++ b/tests/proxy/workspace.t @@ -225,7 +225,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_create.t b/tests/proxy/workspace_create.t index e63191947..9f8821457 100644 --- a/tests/proxy/workspace_create.t +++ b/tests/proxy/workspace_create.t @@ -442,7 +442,7 @@ Note that ws/d/ is now present in the ws ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_discover.t b/tests/proxy/workspace_discover.t index edbe4abb9..57f7a1cac 100644 --- a/tests/proxy/workspace_discover.t +++ b/tests/proxy/workspace_discover.t @@ -102,7 +102,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_edit_commit.t b/tests/proxy/workspace_edit_commit.t index c02bd3ac0..9db68e723 100644 --- a/tests/proxy/workspace_edit_commit.t +++ b/tests/proxy/workspace_edit_commit.t @@ -181,7 +181,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_in_workspace.t b/tests/proxy/workspace_in_workspace.t index 0e06d1374..cfc141fe6 100644 --- a/tests/proxy/workspace_in_workspace.t +++ b/tests/proxy/workspace_in_workspace.t @@ -245,7 +245,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_invalid_trailing_slash.t b/tests/proxy/workspace_invalid_trailing_slash.t index f5bc592fe..0a3837de0 100644 --- a/tests/proxy/workspace_invalid_trailing_slash.t +++ b/tests/proxy/workspace_invalid_trailing_slash.t @@ -184,7 +184,7 @@ Flushed credential cache ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_modify.t b/tests/proxy/workspace_modify.t index 1b1fe595d..bbf5f33ec 100644 --- a/tests/proxy/workspace_modify.t +++ b/tests/proxy/workspace_modify.t @@ -441,7 +441,7 @@ Note that ws/d/ is now present in the ws ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_modify_chain.t b/tests/proxy/workspace_modify_chain.t index 0ef2f59b7..20fb9e825 100644 --- a/tests/proxy/workspace_modify_chain.t +++ b/tests/proxy/workspace_modify_chain.t @@ -249,7 +249,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_modify_chain_prefix_subtree.t b/tests/proxy/workspace_modify_chain_prefix_subtree.t index 784d8ffe7..3c1a8d08a 100644 --- a/tests/proxy/workspace_modify_chain_prefix_subtree.t +++ b/tests/proxy/workspace_modify_chain_prefix_subtree.t @@ -304,7 +304,7 @@ Note that ws/d/ is now present in the ws ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_pre_history.t b/tests/proxy/workspace_pre_history.t index 23f8b99b4..9cd83955f 100644 --- a/tests/proxy/workspace_pre_history.t +++ b/tests/proxy/workspace_pre_history.t @@ -88,7 +88,7 @@ file was created ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_publish.t b/tests/proxy/workspace_publish.t index c4064a33b..9a5abd029 100644 --- a/tests/proxy/workspace_publish.t +++ b/tests/proxy/workspace_publish.t @@ -125,7 +125,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf diff --git a/tests/proxy/workspace_tags.t b/tests/proxy/workspace_tags.t index ffad464f9..2c6aedadf 100644 --- a/tests/proxy/workspace_tags.t +++ b/tests/proxy/workspace_tags.t @@ -231,7 +231,7 @@ ] . |-- josh - | `-- 22 + | `-- 23 | `-- sled | |-- blobs | |-- conf