summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-03-02 20:23:17 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-03 07:06:04 (GMT)
commitfd8fc4ade5c8973b3dca264cc0c26b091982870b (patch)
tree521bbde863248fe3c0fb67daaf64f4802127b4a3
parente74ee784c7daf560044dad4a06fae66732ed414b (diff)
downloadgit-fd8fc4ade5c8973b3dca264cc0c26b091982870b.zip
git-fd8fc4ade5c8973b3dca264cc0c26b091982870b.tar.gz
git-fd8fc4ade5c8973b3dca264cc0c26b091982870b.tar.bz2
git-branch: add -r switch to list refs/remotes/*
If we decide to use refs/remotes/, having a convenient way to list them would be nice. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-branch.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/git-branch.sh b/git-branch.sh
index 6ac961e..663a3a3 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -48,6 +48,12 @@ If you are sure you want to delete it, run 'git branch -D $branch_name'."
exit 0
}
+ls_remote_branches () {
+ git-rev-parse --symbolic --all |
+ sed -ne 's|^refs/\(remotes/\)|\1|p' |
+ sort
+}
+
force=
while case "$#,$1" in 0,*) break ;; *,-*) ;; *) break ;; esac
do
@@ -56,6 +62,10 @@ do
delete_branch "$@"
exit
;;
+ -r)
+ ls_remote_branches
+ exit
+ ;;
-f)
force="$1"
;;