From 3330af6cd405d289595e7ce08b6402a7002a68f0 Mon Sep 17 00:00:00 2001 From: spacewander Date: Sun, 22 Mar 2015 22:55:15 +0800 Subject: [PATCH] sort unless there is only one item --- bin/git-effort | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/git-effort b/bin/git-effort index 4fb2981..ac55d27 100755 --- a/bin/git-effort +++ b/bin/git-effort @@ -137,7 +137,9 @@ trap show_cursor_and_cleanup INT # loop files heading -effort "${files[@]}" | tee $tmp && sort_effort + +effort "${files[@]}" | tee $tmp +test "$(wc -l $tmp | cut -d' ' -f1 )" -gt 1 && sort_effort echo show_cursor_and_cleanup