summaryrefslogtreecommitdiffstats
path: root/src/git-amb
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-02 08:17:41 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-02 08:17:41 +0100
commit0f6d455410f67ca072a9cde61c744b5ce65973a6 (patch)
treef462c9e29aee9fe8eb7f94a87e6fad97a044239c /src/git-amb
parente68463b2ff26100336c35f11baf69e5f574a7f80 (diff)
downloadndim-git-utils-0f6d455410f67ca072a9cde61c744b5ce65973a6.tar.gz
ndim-git-utils-0f6d455410f67ca072a9cde61c744b5ce65973a6.tar.xz
ndim-git-utils-0f6d455410f67ca072a9cde61c744b5ce65973a6.zip
Improve handling of branch params, manpage
Diffstat (limited to 'src/git-amb')
-rwxr-xr-xsrc/git-amb32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/git-amb b/src/git-amb
index 26800c1..fb036b2 100755
--- a/src/git-amb
+++ b/src/git-amb
@@ -73,14 +73,20 @@ cond_cat_path() {
}
amb_init() {
- git_branch="$(git branch | sed -n 's/^* //p')"
+ if test "x$1" = "x"; then
+ git_branch="$(git branch | sed -n 's/^* //p')"
+ elif git branch | sed 's/^[ *] //' | grep "$1" > /dev/null; then
+ git_branch="${1}"
+ else
+ die "Invalid branch \"$1\" given."
+ fi
test "x.git" = "x$(basename "$GIT_DIR")"
top_srcdir="$(cd_to_toplevel && pwd)"
- tmp="$(git config amb.builddir)" || tmp="$GIT_DIR/amb/build"
+ tmp="$(git-config amb.builddir)" || tmp="$GIT_DIR/amb/build"
top_builddir="$(cond_cat_path "${top_srcdir}" "$tmp" "${git_branch}")"
- tmp="$(git config amb.installdir)" || tmp="$GIT_DIR/amb/install"
+ tmp="$(git-config amb.installdir)" || tmp="$GIT_DIR/amb/install"
top_installdir="$(cond_cat_path "${top_srcdir}" "$tmp" "$git_branch")"
amb_detect_configure
@@ -164,11 +170,11 @@ command="$1"
if shift; then
case "$command" in
builddir)
- amb_init
+ amb_init "$@"
echo "$top_builddir"
;;
installdir)
- amb_init
+ amb_init "$@"
echo "$top_installdir"
;;
autoreconf)
@@ -187,22 +193,22 @@ if shift; then
amb_printvars
;;
clean)
- amb_init
- amb_make "$@" clean
+ amb_init "$@"
+ amb_make clean
amb_printvars
;;
distclean)
- amb_init
- amb_make "$@" distclean
+ amb_init "$@"
+ amb_make distclean
amb_printvars
;;
purge)
- amb_init
- amb_purge "$@"
+ amb_init "$@"
+ amb_purge
;;
uninstall)
- amb_init
- amb_uninstall "$@"
+ amb_init "$@"
+ amb_uninstall
;;
sh)
amb_init