diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-04 22:05:34 +0100 | 
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-05 19:38:51 +0100 | 
| commit | a8deb42b4899ce11d1937bda0b59c8b56f230bce (patch) | |
| tree | 4d9146ee431f3d6255dcbcef29466857c8bf271d /src/Command | |
| parent | 54f157fe5e7bb73c5d6e9d24a43aa95754ef0e15 (diff) | |
Execute all git commands with proper git-dir
Diffstat (limited to 'src/Command')
| -rw-r--r-- | src/Command/Run.hs | 9 | 
1 files changed, 2 insertions, 7 deletions
| diff --git a/src/Command/Run.hs b/src/Command/Run.hs index e2e7cc0..b6fd429 100644 --- a/src/Command/Run.hs +++ b/src/Command/Run.hs @@ -19,7 +19,6 @@ import System.Exit  import System.FilePath  import System.FilePath.Glob  import System.IO -import System.Process  import Command  import Config @@ -204,12 +203,8 @@ cmdRun (RunCommand RunOptions {..} args) = do              ( base, tip ) <- case mbBase of                  Just base -> return ( base, paramTip )                  Nothing -> liftIO $ do -                    [ deref ] <- readProcessWithExitCode "git" [ "symbolic-ref", "--quiet", T.unpack paramTip ] "" >>= \case -                        ( ExitSuccess, out, _ ) -> return $ lines out -                        ( _, _, _ ) -> return [ T.unpack paramTip ] -                    [ _, tip ] : _ <- fmap words . lines <$> readProcess "git" [ "show-ref", deref ] "" -                    [ base ] <- lines <$> readProcess "git" [ "for-each-ref", "--format=%(upstream)", tip ] "" -                    return ( T.pack base, T.pack tip ) +                    Just base <- findUpstreamRef repo paramTip +                    return ( base, paramTip )              rangeSource repo base tip          branches <- mapM (watchBranchSource repo) roNewCommitsOn |