]> git.ipfire.org Git - thirdparty/git.git/commitdiff
scalar-unregister: handle error codes greater than 0
authorVictoria Dye <vdye@github.com>
Thu, 18 Aug 2022 21:40:47 +0000 (21:40 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 04:35:31 +0000 (21:35 -0700)
When 'scalar unregister' tries to disable maintenance and remove an
enlistment, ensure that the return value is nonzero if either operation
produces *any* nonzero return value, not just when they return a value less
than 0.

Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/scalar/scalar.c

index 92b648f35118359ee1bc0dbcf452842dba12abe1..8ef8dd55041622a26807b16c9e6c192d37f76355 100644 (file)
@@ -223,10 +223,10 @@ static int unregister_dir(void)
 {
        int res = 0;
 
-       if (toggle_maintenance(0) < 0)
+       if (toggle_maintenance(0))
                res = -1;
 
-       if (add_or_remove_enlistment(0) < 0)
+       if (add_or_remove_enlistment(0))
                res = -1;
 
        return res;