diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-07-22 10:35:51 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-07-22 10:44:04 +0530 |
| commit | d40ab7a488e0b53b9541652e588b62879bc69bba (patch) | |
| tree | f73227d9117773969828ce43d30d4de5934e14c6 /cgit/ssh/git-shell-commands/fork | |
| parent | 4c142d2a977a2c377ea3bef30fa986010056ba3e (diff) | |
| download | bacchus-remote-main.tar.gz bacchus-remote-main.zip | |
Diffstat (limited to '')
| -rwxr-xr-x | cgit/ssh/git-shell-commands/fork | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/cgit/ssh/git-shell-commands/fork b/cgit/ssh/git-shell-commands/fork index c2bc799..d09985a 100755 --- a/cgit/ssh/git-shell-commands/fork +++ b/cgit/ssh/git-shell-commands/fork @@ -2,21 +2,12 @@ set -eu +. "$(dirname $0)/_utils/input.sh" + remote_host="git.ediblemonad.dev" owner_info="Akshay Nair <phenax5@gmail.com>" -if [ $# -lt 2 ]; then - echo "Usage: fork <name> <url>" 1>&2 - exit 1 -fi - -repo_name="$1"; shift 1; -[ -z "$repo_name" ] && echo "Error: empty repo name" 1>&2 && exit 1 -(echo "$repo_name" | grep -q "^[A-Za-z0-9_-]\+$" 2>/dev/null) || (echo "Error: invalid repo name" 1>&2 && exit 1) - -remote_repo_url="$1"; shift 1; -[ -z "$remote_repo_url" ] && echo "Error: empty repo url" 1>&2 && exit 1 - +repo_name="$(input_repo_name)"; repo_dir="/git/${repo_name}.git" if [ -d "$repo_dir" ]; then @@ -24,6 +15,9 @@ if [ -d "$repo_dir" ]; then exit 1; fi +description="$(input_repo_description "$repo_dir")" +remote_repo_url="$(input_repo_remote_url)"; + git clone --bare "$remote_repo_url" "$repo_dir" cd "$repo_dir" |
