stagit
static git repository generator
git clone https://9o.is/git/stagit.git
commit 5e495b0f011a395d824ff012f9bc2348e6669265 parent 194eaaa5381bbfe3c045e5c17e106966c5ffae5f Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sat, 21 May 2016 18:37:53 +0200 refs_cmp: simplify check, functionally the same Diffstat:
| M | stagit.c | | | 9 | +++------ |
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/stagit.c b/stagit.c @@ -883,13 +883,10 @@ refs_cmp(const void *v1, const void *v2) { git_reference *r1 = (*(git_reference **)v1); git_reference *r2 = (*(git_reference **)v2); - int t1, t2; - - t1 = git_reference_is_branch(r1); - t2 = git_reference_is_branch(r2); + int r; - if (t1 != t2) - return t1 - t2; + if ((r = git_reference_is_branch(r1) - git_reference_is_branch(r2))) + return r; return strcmp(git_reference_shorthand(r1), git_reference_shorthand(r2));