fix(tree): check now if the tree snapshot already exists
This commit is contained in:
parent
f19209ba0a
commit
e2d026502f
1 changed files with 7 additions and 0 deletions
|
|
@ -62,6 +62,13 @@ void snapshot_tree(FileInfoBuffer* tree, char* hash) {
|
|||
mkdir(dir_path, 0755);
|
||||
snprintf(file_path, sizeof(file_path), "%s/%s", dir_path, hash+2);
|
||||
|
||||
if (access(file_path, F_OK) == 0) {
|
||||
free(tmp);
|
||||
file_info_buffer_free(files);
|
||||
free(root);
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* fp = fopen(file_path, "wb");
|
||||
if (!fp) {
|
||||
perror("ERROR: cannot open path in snapshot_tree!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue