webapp: Make an initial, empty commit so there is a master branch

Several things only happen when on a branch, so make sure we're on one.
This commit is contained in:
Joey Hess 2012-10-30 19:12:05 -04:00
parent 96c7a5ce32
commit 0cf152b88b
3 changed files with 14 additions and 3 deletions

View file

@ -155,5 +155,6 @@ manualPull currentbranch remotes = do
syncNewRemote :: Remote -> Assistant () syncNewRemote :: Remote -> Assistant ()
syncNewRemote remote = do syncNewRemote remote = do
updateSyncRemotes updateSyncRemotes
thread <- asIO2 reconnectRemotes thread <- asIO $ do
void $ liftIO $ forkIO $ thread False [remote] reconnectRemotes False [remote]
void $ liftIO $ forkIO $ thread

View file

@ -20,6 +20,7 @@ import Init
import qualified Git import qualified Git
import qualified Git.Construct import qualified Git.Construct
import qualified Git.Config import qualified Git.Config
import qualified Git.Command
import qualified Annex import qualified Annex
import Locations.UserConfig import Locations.UserConfig
import Utility.FreeDesktop import Utility.FreeDesktop
@ -281,11 +282,19 @@ inDir dir a = do
state <- Annex.new =<< Git.Config.read =<< Git.Construct.fromPath dir state <- Annex.new =<< Git.Config.read =<< Git.Construct.fromPath dir
Annex.eval state a Annex.eval state a
{- Initializes a git-annex repository in a directory with a description. -}
initRepo :: FilePath -> Maybe String -> IO UUID initRepo :: FilePath -> Maybe String -> IO UUID
initRepo dir desc = inDir dir $ do initRepo dir desc = inDir dir $ do
{- Initialize a git-annex repository in a directory with a description. -}
unlessM isInitialized $ unlessM isInitialized $
initialize desc initialize desc
unlessM (Git.Config.isBare <$> gitRepo) $
{- Initialize the master branch, so things that expect
- to have it will work, before any files are added. -}
void $ inRepo $ Git.Command.runBool "commit"
[ Param "--allow-empty"
, Param "-m"
, Param "created repository"
]
getUUID getUUID
{- Adds a directory to the autostart file. -} {- Adds a directory to the autostart file. -}

1
debian/changelog vendored
View file

@ -33,6 +33,7 @@ git-annex (3.20121018) UNRELEASED; urgency=low
to test a key's presence. to test a key's presence.
* The standalone tarball's runshell now takes care of installing a * The standalone tarball's runshell now takes care of installing a
~/.ssh/git-annex-shell wrapper the first time it's run. ~/.ssh/git-annex-shell wrapper the first time it's run.
* webapp: Make an initial, empty commit so there is a master branch
-- Joey Hess <joeyh@debian.org> Wed, 17 Oct 2012 14:24:10 -0400 -- Joey Hess <joeyh@debian.org> Wed, 17 Oct 2012 14:24:10 -0400