Skip to content

Commit d3e50c3

Browse files
committed
sort by date when dates are shown
1 parent 5a39497 commit d3e50c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-branch-status

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ function AssertIsNotBareRepo
215215
function GetRefs # (refs_dir)
216216
{
217217
local refs_dir=$1
218+
local fmt='%(refname:short) %(upstream:short)'
219+
local sort=$( (( $SHOW_DATES )) && echo '--sort=creatordate')
218220

219-
git for-each-ref --format="%(refname:short) %(upstream:short)" $refs_dir 2> /dev/null
221+
git for-each-ref --format="$fmt" $sort $refs_dir 2> /dev/null
220222
}
221223

222224
function GetLocalRefs

0 commit comments

Comments
 (0)