Skip to content

Commit 3c5bee1

Browse files
committed
fix: Use git apply --3way when pushing
Some patches can only be applied correctly with a 3-way merge. When pushing patches, StGit already generates/uses diffs that have the appropriate id hashes to use `git apply --3way`, so just need to use that option. Fixes: #225
1 parent 138249a commit 3c5bee1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stupid/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<'repo, 'index> StupidContext<'repo, 'index> {
167167

168168
let apply_output = self
169169
.git_in_work_root()
170-
.args(["apply", "--cached"]) // --3way
170+
.args(["apply", "--cached", "--3way"])
171171
.stdin(diff_tree_child.stdout.take().unwrap())
172172
.stdout(Stdio::null())
173173
.output_git()?
@@ -212,7 +212,7 @@ impl<'repo, 'index> StupidContext<'repo, 'index> {
212212

213213
let apply_output = self
214214
.git_in_work_root()
215-
.args(["apply", "--cached"]) // --3way
215+
.args(["apply", "--cached", "--3way"])
216216
.stdin(Stdio::piped())
217217
.stdout(Stdio::null())
218218
.in_and_out(&diff)?;

0 commit comments

Comments
 (0)