From b52b106ac50a0100e41843e2bd2edcbb74a10b6e Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Wed, 23 Jul 2025 10:50:17 +0200 Subject: allow picking patches from files --- Main.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index 37c2ca6..4983f64 100644 --- a/Main.hs +++ b/Main.hs @@ -344,7 +344,10 @@ runCmd CmdPatch {..} cfg = do withSystemTempDirectory "werge-patch" $ \workdir -> do let f = workdir "file" bracketFile patchMy ReadMode $ \h -> hSplitToFile cfg h f - _ <- runPatch f stdin + _ <- + case patchInput of + Nothing -> runPatch f stdin + Just path -> bracketFile path ReadMode $ runPatch f conflicted <- pmerge f >>= format cfg stdout -- TODO try to resolve more? if conflicted then exitWith (ExitFailure 1) -- cgit v1.2.3