Test commit
[cogito/jonas.git] / cg-branch-chg
blob4b2ba9c6d248762a8c9246a85f49eacd050a299f
1 #!/usr/bin/env bash
3 # Change an existing remote branch repository URL
4 # Copyright (c) Petr Baudis, 2005
6 # Takes the branch name and new source location as parameters.
8 # Terminology note: This command concerns remote branches, not the local
9 # ones (those managed by `cg-switch`).
11 # Testsuite: TODO
13 USAGE="cg-branch-chg BRANCH_NAME NEW_LOCATION"
14 _git_wc_unneeded=1
16 . "${COGITO_LIB}"cg-Xlib || exit 1
18 name="${ARGS[0]}"
19 location="${ARGS[1]}"
20 ([ -n "$name" ] && [ -n "$location" ]) || usage
22 [ -s "$_git/branches/$name" ] || die "branch does not exist"
23 echo "$location" >"$_git/branches/$name"