diff options
| author | 2026-05-18 01:25:46 -0600 | |
|---|---|---|
| committer | 2026-05-18 01:25:46 -0600 | |
| commit | dc54a69b7552d8d44adf25b8009992c4a2b395be (patch) | |
| tree | 0c1864e9239bf02fc83408be378d983070250ead /mkrepo | |
init
Diffstat (limited to 'mkrepo')
| -rwxr-xr-x | mkrepo | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -0,0 +1,29 @@ +#!/bin/bash +# Make a new repo. + +declare -a extra_git_args + +if [ "$1" = "--sha256" ]; then + extra_git_args+=( --object-format=sha256 ) + shift +fi + +if [ $# -ne 1 ]; then + echo "Syntax: $0 [--sha256] <name>" >&2 + exit 1 +fi + +if [[ $1 == *..* ]]; then + echo "No .." >&2 + exit 1 +fi +if [[ $1 == */* ]]; then + echo "No /" >&2 + exit 1 +fi + + +git init --shared --bare "${extra_git_args[@]}" "$HOME/$1.git" +git -C "$HOME/$1.git" config --unset receive.denyNonFastForwards + +echo "Created $USER@$(hostname -f):$1.git" |
