Skip to content

Commit 624802b

Browse files
committed
[SP-2587] Use relative path for path_id
1 parent abc9585 commit 624802b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/scanoss/scanners/folder_hasher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ def _hash_calc_from_node(self, node: DirectoryNode) -> dict:
194194
dict: The computed hash data for the node.
195195
"""
196196
hash_data = self._hash_calc(node)
197+
rel_path = Path(node.path).relative_to(self.scan_dir)
197198

198199
return {
199-
'path_id': node.path,
200+
'path_id': str(rel_path),
200201
'sim_hash_names': f'{hash_data["name_hash"]:02x}' if hash_data['name_hash'] is not None else None,
201202
'sim_hash_content': f'{hash_data["content_hash"]:02x}' if hash_data['content_hash'] is not None else None,
202203
'sim_hash_dir_names': f'{hash_data["dir_hash"]:02x}' if hash_data['dir_hash'] is not None else None,

0 commit comments

Comments
 (0)