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>
This commit is contained in:

committed by
Junio C Hamano

parent
e74ee784c7
commit
fd8fc4ade5
@ -48,6 +48,12 @@ If you are sure you want to delete it, run 'git branch -D $branch_name'."
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ls_remote_branches () {
|
||||||
|
git-rev-parse --symbolic --all |
|
||||||
|
sed -ne 's|^refs/\(remotes/\)|\1|p' |
|
||||||
|
sort
|
||||||
|
}
|
||||||
|
|
||||||
force=
|
force=
|
||||||
while case "$#,$1" in 0,*) break ;; *,-*) ;; *) break ;; esac
|
while case "$#,$1" in 0,*) break ;; *,-*) ;; *) break ;; esac
|
||||||
do
|
do
|
||||||
@ -56,6 +62,10 @@ do
|
|||||||
delete_branch "$@"
|
delete_branch "$@"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
-r)
|
||||||
|
ls_remote_branches
|
||||||
|
exit
|
||||||
|
;;
|
||||||
-f)
|
-f)
|
||||||
force="$1"
|
force="$1"
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user