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>
Eric Wong committed
Mar 2, 2006 at 12:23 UTC
fd8fc4ade5c8973b3dca264cc0c26b091982870b
1 file changed
+10
git-branch.sh
+10
@@ -48,6 +48,12 @@ If you are sure you want to delete it, run 'git branch -D $branch_name'."
48
exit 0
49
}
50
51
+ls_remote_branches () {
52
+ git-rev-parse --symbolic --all |
53
+ sed -ne 's|^refs/\(remotes/\)|\1|p' |
54
+ sort
55
+}
56
+
57
force=
58
while case "$#,$1" in 0,*) break ;; *,-*) ;; *) break ;; esac
59
do
@@ -56,6 +62,10 @@ do
62
delete_branch "$@"
63
exit
64
;;
65
+ -r)
66
+ ls_remote_branches
67
+ exit
68
+ ;;
69
-f)
70
force="$1"
71
;;