@@ -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) $