diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-02-28 13:58:41 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-02-28 13:58:41 -0300 |
commit | f8c90d57f673d9accaa616620660aff70f0d9246 (patch) | |
tree | d4d97b9392999f31c8037a7bf53b83c57e13deb3 /lib | |
parent | 1d33d02bd37cb38b494991ca0f797dfcaea12e39 (diff) | |
download | hydra-f8c90d57f673d9accaa616620660aff70f0d9246.tar.gz hydra-f8c90d57f673d9accaa616620660aff70f0d9246.tar.bz2 |
Repository initialization
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hydra/git | 16 |
1 files changed, 16 insertions, 0 deletions
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" + ) +} |