Fix status-script
This commit is contained in:
parent
027381614c
commit
7070c819da
1 changed files with 2 additions and 3 deletions
|
@ -18,9 +18,8 @@ let
|
||||||
|
|
||||||
isDirty gitDir = ((/= "") <$> (git "-C" gitDir "status" "--porcelain" |> captureTrim)) `catch` (\(_ :: SomeException) -> pure True)
|
isDirty gitDir = ((/= "") <$> (git "-C" gitDir "status" "--porcelain" |> captureTrim)) `catch` (\(_ :: SomeException) -> pure True)
|
||||||
isUnpushed gitDir = do
|
isUnpushed gitDir = do
|
||||||
gitHead <- tryCmd (git "-C" gitDir "rev-parse" "HEAD")
|
revs <- LBS.split 10 <$> tryCmd (git "-C" gitDir "rev-parse" "@{u}" "HEAD")
|
||||||
origin <- tryCmd (git "-C" gitDir "rev-parse" "origin/HEAD")
|
pure $ length revs /= 2 || (revs !!? 0 /= revs !!? 1)
|
||||||
pure (gitHead /= origin)
|
|
||||||
|
|
||||||
tryCmd x = ignoreFailure x |> captureTrim
|
tryCmd x = ignoreFailure x |> captureTrim
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue