Skip to content

Commit

Permalink
Check if ignore new name or name
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Oct 31, 2024
1 parent 6ca457b commit c732c82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
13 changes: 8 additions & 5 deletions fileserver/sync_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,11 +1077,14 @@ func includeInvalidPath(baseCommit, newCommit *commitmgr.Commit) bool {
}

for _, entry := range results {
if entry.NewName != "" && shouldIgnore(entry.NewName) {
return true
}
if entry.NewName == "" && shouldIgnore(entry.Name) {
return true
if entry.NewName != "" {
if shouldIgnore(entry.NewName) {
return true
}
} else {
if shouldIgnore(entry.Name) {
return true
}
}
}

Expand Down
17 changes: 10 additions & 7 deletions server/http-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,13 +1063,16 @@ include_invalid_path (SeafCommit *base_commit, SeafCommit *new_commit) {
DiffEntry *diff_entry;
for (ptr = diff_entries; ptr; ptr = ptr->next) {
diff_entry = ptr->data;
if (diff_entry->new_name && should_ignore(diff_entry->new_name)) {
ret = TRUE;
break;
}
if (!diff_entry->new_name && should_ignore(diff_entry->name)) {
ret = TRUE;
break;
if (diff_entry->new_name) {
if (should_ingore(diff_entry->new_name)) {
ret = TRUE;
break;
}
} else {
if (should_ignore(diff_entry->name)) {
ret = TRUE;
break;
}
}
}

Expand Down

0 comments on commit c732c82

Please sign in to comment.