Skip to content

Commit 43d511d

Browse files
authored
fix: pass git commit and url to GIT_PATCH rule (#690)
2 parents 72952e5 + eb3ec31 commit 43d511d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/download.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,13 @@ impl Download {
132132
env: &HashMap<&String, String>,
133133
) -> Result<Vec<String>> {
134134
let patches = self.patches.as_ref().unwrap();
135+
let mut rule_env = IndexMap::new();
135136
let rulename = match &self.source {
136-
Source::Git { .. } => "GIT_PATCH",
137+
Source::Git(Git::Commit { url, commit }) => {
138+
rule_env.insert("commit".to_string(), commit.to_string());
139+
rule_env.insert("url".to_string(), url.to_string());
140+
"GIT_PATCH"
141+
}
137142
_ => return Err(anyhow!("unsupported download type for patching")),
138143
};
139144

@@ -163,6 +168,7 @@ impl Download {
163168
.inputs(patches)
164169
.out(tagfile_patched.as_path())
165170
.deps(Some(download_dep))
171+
.env(&rule_env)
166172
.build()
167173
.unwrap();
168174

0 commit comments

Comments
 (0)