@@ -67,40 +67,21 @@ mod find_youngest_matching_commit {
67
67
fn contained_string_matches() {
68
68
let repo = repo("complex_graph").unwrap();
69
69
70
-
// See the comment on `skip_some_baselines` in the `regex_matches` test function below.
71
-
let skip_some_baselines = !is_ci::cached()
72
-
&& std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some()
73
-
&& ((2, 47, 0)..(2, 48, 0)).contains(&gix_testtools::GIT_VERSION);
74
-
75
-
if skip_some_baselines {
76
-
assert_eq!(
77
-
parse_spec_no_baseline(":/message", &repo).unwrap(),
78
-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
79
-
);
80
-
} else {
81
-
assert_eq!(
82
-
parse_spec(":/message", &repo).unwrap(),
83
-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
84
-
);
85
-
}
70
+
assert_eq!(
71
+
parse_spec(":/message", &repo).unwrap(),
72
+
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
73
+
);
86
74
87
75
assert_eq!(
88
76
parse_spec("@^{/!-B}", &repo).unwrap(),
89
77
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo)),
90
78
"negations work as well"
91
79
);
92
80
93
-
if skip_some_baselines {
94
-
assert_eq!(
95
-
parse_spec_no_baseline(":/!-message", &repo).unwrap(),
96
-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
97
-
);
98
-
} else {
99
-
assert_eq!(
100
-
parse_spec(":/!-message", &repo).unwrap(),
101
-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
102
-
);
103
-
}
81
+
assert_eq!(
82
+
parse_spec(":/!-message", &repo).unwrap(),
83
+
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
84
+
);
104
85
105
86
assert_eq!(
106
87
parse_spec_no_baseline(":/messa.e", &repo).unwrap_err().to_string(),
@@ -114,52 +95,20 @@ mod find_youngest_matching_commit {
114
95
fn regex_matches() {
115
96
let repo = repo("complex_graph").unwrap();
116
97
117
-
// Traversal order with `:/` was broken in Git 2.47.*, so some `parse_spec` assertions
118
-
// fail. The fix is in Git 2.48.* but is not backported. This causes incorrect baselines to
119
-
// be computed when `GIX_TEST_IGNORE_ARCHIVES` is set. If that is not set, then archived
120
-
// baselines are used and there is no problem. On CI, we assume a sufficiently new version
121
-
// of Git. Otherwise, if `GIX_TEST_IGNORE_ARCHIVES` is set and Git 2.47.* is used, we skip
122
-
// the baseline check, to allow the rest of the test to proceed. This accommodates local
123
-
// development environments with a system-provided Git 2.47.*, though archives generated on
124
-
// such a system should not be committed, as they would still contain incorrect baselines.
125
-
// Please note that this workaround may be removed in the future. For more details, see:
126
-
//
127
-
// - https://lore.kernel.org/git/Z1LJSADiStlFicTL@pks.im/T/
128
-
// - https://lore.kernel.org/git/Z1LtS-8f8WZyobz3@pks.im/T/
129
-
// - https://github.com/git/git/blob/v2.48.0/Documentation/RelNotes/2.48.0.txt#L294-L296
130
-
// - https://github.com/GitoxideLabs/gitoxide/issues/1622
131
-
let skip_some_baselines = !is_ci::cached()
132
-
&& std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some()
133
-
&& ((2, 47, 0)..(2, 48, 0)).contains(&gix_testtools::GIT_VERSION);
134
-
135
-
if skip_some_baselines {
136
-
assert_eq!(
137
-
parse_spec_no_baseline(":/mes.age", &repo).unwrap(),
138
-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
139
-
);
140
-
} else {
141
-
assert_eq!(
142
-
parse_spec(":/mes.age", &repo).unwrap(),
143
-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
144
-
);
145
-
}
98
+
assert_eq!(
99
+
parse_spec(":/mes.age", &repo).unwrap(),
100
+
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
101
+
);
146
102
147
103
assert_eq!(
148
104
parse_spec(":/not there", &repo).unwrap_err().to_string(),
149
105
"None of 10 commits reached from all references matched regex \"not there\""
150
106
);
151
107
152
-
if skip_some_baselines {
153
-
assert_eq!(
154
-
parse_spec_no_baseline(":/!-message", &repo).unwrap(),
155
-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
156
-
);
157
-
} else {
158
-
assert_eq!(
159
-
parse_spec(":/!-message", &repo).unwrap(),
160
-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
161
-
);
162
-
}
108
+
assert_eq!(
109
+
parse_spec(":/!-message", &repo).unwrap(),
110
+
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
111
+
);
163
112
164
113
assert_eq!(
165
114
parse_spec("@^{/!-B}", &repo).unwrap(),
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4