File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,10 +74,10 @@ def test_compare_branches_major_only_vs_major_minor():
7474def test_compare_branches_major_minor_micro_vs_major_minor ():
7575 branch1 = ((4 , 3 , 2 ),)
7676 branch2 = ((4 , 3 ),)
77- assert compare_branches (branch1 , branch2 ) == - 2
77+ assert compare_branches (branch1 , branch2 ) == - 997
7878
7979
8080def test_compare_branches_major_minor_vs_major_minor_micro ():
8181 branch1 = ((4 , 3 ),)
8282 branch2 = ((4 , 3 , 2 ),)
83- assert compare_branches (branch1 , branch2 ) == 2
83+ assert compare_branches (branch1 , branch2 ) == 997
Original file line number Diff line number Diff line change @@ -63,22 +63,22 @@ def compare_branches(branch1, branch2):
6363 return - 1
6464
6565 # Both are major.minor or longer - compare normally
66- minor1 = version1 [1 ] if len (version1 ) > 1 else 0
67- minor2 = version2 [1 ] if len (version2 ) > 1 else 0
66+ minor1 = version1 [1 ] if len (version1 ) > 1 else 999
67+ minor2 = version2 [1 ] if len (version2 ) > 1 else 999
6868
6969 # Compare minor versions
7070 if minor1 != minor2 :
7171 return minor1 - minor2
7272
7373 # Same major.minor - extract micro versions
7474 # Default to 0 if no micro
75- micro1 = version1 [2 ] if len (version1 ) > 2 else 0
75+ micro1 = version1 [2 ] if len (version1 ) > 2 else 999
7676 # Default to 0 if no micro
77- micro2 = version2 [2 ] if len (version2 ) > 2 else 0
77+ micro2 = version2 [2 ] if len (version2 ) > 2 else 999
7878
7979 # Compare micro versions
8080 if micro1 != micro2 :
81- return micro2 - micro1
81+ return micro1 - micro2
8282 else :
8383 return 0
8484
You can’t perform that action at this time.
0 commit comments