From: Petr Baudis Date: Mon, 22 Sep 2008 15:24:25 +0000 (+0200) Subject: tg info, tg patch: Work on top-base HEAD too X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=commitdiff_plain;h=c263301596f83da5c521ea3d0c61e0953c9ae1de tg info, tg patch: Work on top-base HEAD too --- diff --git a/tg-info.sh b/tg-info.sh index 17eca60..9076247 100644 --- a/tg-info.sh +++ b/tg-info.sh @@ -20,7 +20,7 @@ while [ -n "$1" ]; do esac done -[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')" +[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')" base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" || die "not a TopGit-controlled branch" diff --git a/tg-patch.sh b/tg-patch.sh index 7a24718..97338ab 100644 --- a/tg-patch.sh +++ b/tg-patch.sh @@ -20,7 +20,7 @@ while [ -n "$1" ]; do esac done -[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/heads/##')" +[ -n "$name" ] || name="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')" base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" || die "not a TopGit-controlled branch"