Skip to content

Commit 874f69d

Browse files
committed
IOS APP中分支提交数和前台分支提交数不一致
1 parent c66131d commit 874f69d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Coding_iOS/Models/EACodeBranches.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,18 @@ - (instancetype)init
2020
}
2121

2222
- (NSString *)curBaseStr{
23-
return [(CodeBranchOrTag *)self.list.firstObject last_commit].commitId;
23+
CodeBranchOrTag *defaultB = nil;
24+
for (CodeBranchOrTag *itemB in self.list) {
25+
if (itemB.is_default_branch.boolValue) {
26+
defaultB = itemB;
27+
break;
28+
}
29+
}
30+
if (!defaultB) {
31+
defaultB = self.list.firstObject;
32+
}
33+
return defaultB.last_commit.commitId;
34+
// return [(CodeBranchOrTag *)self.list.firstObject last_commit].commitId;
2435
}
2536

2637
//https://coding.net/api/user/ease/project/CodingTest/git/branches/filter?page=1&q=

0 commit comments

Comments
 (0)