on master help sign in
Fix unpacking of thunk with non-default branch
commit89ac47bcc3b457827545d9b781cabda1ae4c4238 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateMon 22 Oct 2018, 13:20 (8 years ago) parent39bebc2
1 file changed+2−3
lib/command/src/Obelisk/Command/Thunk.hs+2−3
lib/command/src/Obelisk/Command/Thunk.hs+2−3
@@ -582,12 +582,11 @@ unpackThunk' noTrail thunkDir = readThunk thunkDir >>= \case
582582 git $ [ "clone" ]
583583 ++ ("--recursive" <$ guard (_gitSource_fetchSubmodules s))
584584 ++ [ T.unpack $ render $ _gitSource_url s ]
585+ ++ do branch <- maybeToList $ _gitSource_branch s
586+ [ "--branch", T.unpack $ untagName branch ]
585587 git ["reset", "--hard", Ref.toHexString $ _thunkRev_commit $ _thunkPtr_rev tptr]
586588 when (_gitSource_fetchSubmodules s) $
587589 git ["submodule", "update", "--recursive", "--init"]
588− case _gitSource_branch s of
589− Just b -> git ["branch", "-u", "origin/" <> T.unpack (untagName $ b)]
590− Nothing -> pure ()
591590
592591 liftIO $ createDirectory obGitDir
593592 callProcessAndLogOutput (Notice, Error) $