summaryrefslogtreecommitdiff
path: root/lib/hydra/git
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hydra/git')
-rw-r--r--lib/hydra/git16
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"
+ )
+}