summaryrefslogtreecommitdiffstats
path: root/repo-access.sh
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-09-03 16:32:01 -0400
committerMalf Furious <m@lfurio.us>2017-09-03 16:32:01 -0400
commitfa68505117215d5a49fa0a13bbc1ec5e07020138 (patch)
treeccdc49a18d7140d28e83e56415bef9eba4d6291c /repo-access.sh
parent2f69a3efcef8df278fb37e42153124e2a5858604 (diff)
downloadsystrunk-fa68505117215d5a49fa0a13bbc1ec5e07020138.tar.gz
systrunk-fa68505117215d5a49fa0a13bbc1ec5e07020138.zip
Rewrite checkout mod to drop remote support
Also, refactored repo check to the repo-access mod.
Diffstat (limited to '')
-rw-r--r--repo-access.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/repo-access.sh b/repo-access.sh
index 2b6a5cc..b599dc8 100644
--- a/repo-access.sh
+++ b/repo-access.sh
@@ -1,4 +1,21 @@
##
+# systr_repo_check [<path>=PATH]
+#
+# Assert that the local repository path exists and is valid.
+##
+function systr_repo_check
+{
+ if [ $# -gt 0 ]; then
+ path="$1"
+ fi
+
+ if [ ! -f "$path/refs/HEAD" ]; then
+ echo "Fatal: $path is not a repository" >&2
+ exit 1
+ fi
+}
+
+##
# systr_repo_resolve_reference <ref>
#
# Resolve a revision name to a commit ID. The result is printed to