From b0f7f06f6e656cefdf855ad39b2d62cab5bd0b85 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com> Date: Fri, 24 Feb 2017 08:28:37 +0100 Subject: [PATCH] Update docstring to clarify the ambiguity around symlinks --- swh/model/git.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/swh/model/git.py b/swh/model/git.py index c8b4bbe8..1f95b7b6 100644 --- a/swh/model/git.py +++ b/swh/model/git.py @@ -157,12 +157,13 @@ def compute_link_metadata(linkpath): def compute_blob_metadata(filepath): - """Given a filepath, compute the git metadata. + """Given a filepath resolving to a regular file, compute the metadata. + Other file types (fifo, character or block device, symlink) will + be considered empty regular file. To deal properly with symlinks, + use swh.model.git.compute_link_metadata. Args: - filepath: absolute pathname of the file. - This could be special files (fifo, character or - block device), they will be considered empty files. + filepath: absolute pathname of the regular file. Returns: Dictionary of values: -- GitLab