on master help sign in
Add test to ensure we unpack the correct branch
commitfadd164a79337d81c0a2d16dc207a62f35a9185a authorTom Smalley <tfsmalley@gmail.com> dateWed 24 Oct 2018, 15:40 (8 years ago) parent00f7dc0
1 file changed+8
lib/selftest/src/Obelisk/SelfTest.hs+8
lib/selftest/src/Obelisk/SelfTest.hs+8
@@ -180,6 +180,14 @@ main = do
180180 assertRevEQ eu eupu
181181 assertRevNE e eu
182182
183+ it "unpacks the correct branch" $ inTmp $ \dir -> do
184+ let branch = "master"
185+ run_ "git" ["clone", "https://github.com/reflex-frp/reflex.git", toTextIgnore dir, "--branch", branch]
186+ run_ "ob" ["thunk", "pack", toTextIgnore dir]
187+ run_ "ob" ["thunk", "unpack", toTextIgnore dir]
188+ branch' <- run "git" ["rev-parse", "--abbrev-ref", "HEAD"]
189+ liftIO $ assertEqual "" branch (T.strip branch')
190+
183191 it "can pack and unpack plain git repos" $ do
184192 shelly_ $ withSystemTempDirectory "git-repo" $ \dir -> do
185193 let repo = toTextIgnore $ dir </> ("repo" :: String)