From fd8fc4ade5c8973b3dca264cc0c26b091982870b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Mar 2006 12:23:17 -0800 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- git-branch.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/git-branch.sh b/git-branch.sh index 6ac961e6..663a3a37 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" ;; -- 2.11.0