1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-20 10:41:22 +00:00

Only diff new dirs and files (#764)

* Ci use python 3.12

Only diff new dirs and files

* Modify comment

---------

Co-authored-by: Heran Yang <heran.yang@seafile.com>
This commit is contained in:
feiniks
2025-06-24 11:50:29 +08:00
committed by GitHub
parent ee13c7c5d0
commit b139442436
4 changed files with 56 additions and 3 deletions

View File

@@ -1171,6 +1171,31 @@ static int
check_dir_cb (int n, const char *basedir, SeafDirent *dirs[], void *data,
gboolean *recurse)
{
SeafDirent *dir1 = dirs[0];
SeafDirent *dir2 = dirs[1];
if (!dir1) {
// if dir2 is empty, stop diff.
if (g_strcmp0 (dir2->id, EMPTY_SHA1) == 0) {
*recurse = FALSE;
} else {
*recurse = TRUE;
}
return 0;
}
// if dir2 is not exist, stop diff.
if (!dir2) {
*recurse = FALSE;
return 0;
}
// if dir1 and dir2 are the same or dir2 is empty, stop diff.
if (g_strcmp0 (dir1->id, dir2->id) == 0 || g_strcmp0 (dir2->id, EMPTY_SHA1) == 0) {
*recurse = FALSE;
return 0;
}
return 0;
}