From f8c90d57f673d9accaa616620660aff70f0d9246 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Feb 2014 13:58:41 -0300 Subject: Repository initialization --- lib/hydra/git | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/hydra/git') diff --git a/lib/hydra/git b/lib/hydra/git index 34ba053..0908f54 100644 --- a/lib/hydra/git +++ b/lib/hydra/git @@ -31,3 +31,19 @@ function hydra_is_git { fi fi } + +# Initialize a repository +function hydra_git_init { + local repo="$1" + + if [ -z "$repo" ] || [ ! -d "$repo" ] || [ -d "$repo/.git" ]; then + return + fi + + ( + cd $repo + git init + git add . + git commit -m "Initial import" + ) +} -- cgit v1.2.3