Skip to content

Commit bfe72c8

Browse files
committed
Don't run git status on Windows
1 parent b78b8b9 commit bfe72c8

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

etc/scripts/release.hs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,24 @@ rules global@Global{..} args = do
194194
releaseCheckDir </> binaryExeFileName %> \out -> do
195195
need [releaseBinDir </> binaryName </> stackExeFileName]
196196

197-
-- Run "git diff" so we can see what changes exist, in case things fail below
198-
() <- cmd "git diff"
197+
-- Symlinks in the repo cause a spurious git status change notification
198+
-- on Windows, so we don't run this on Windows. Instead we rely on
199+
-- Linux/Mac testing for that.
199200

200-
Stdout dirty <- cmd "git status --porcelain"
201-
when (not gAllowDirty && not (null (trim dirty))) $
202-
error $ concat
203-
[ "Working tree is dirty. Use --"
204-
, allowDirtyOptName
205-
, " option to continue anyway. Output:\n"
206-
, show dirty
207-
]
201+
case platformOS of
202+
Windows -> pure ()
203+
_ -> do
204+
-- Run "git diff" so we can see what changes exist, in case things fail below
205+
() <- cmd "git diff"
206+
207+
Stdout dirty <- cmd "git status --porcelain"
208+
when (not gAllowDirty && not (null (trim dirty))) $
209+
error $ concat
210+
[ "Working tree is dirty. Use --"
211+
, allowDirtyOptName
212+
, " option to continue anyway. Output:\n"
213+
, show dirty
214+
]
208215
() <- cmd
209216
[gProjectRoot </> releaseBinDir </> binaryName </> stackExeFileName]
210217
(stackArgs global)

0 commit comments

Comments
 (0)