Skip to content

Commit d7855db

Browse files
committed
[Repository] more forgiving lfs_track
1 parent b21b7c1 commit d7855db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/huggingface_hub/repository.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,12 @@ def git_config_username_and_email(
172172
cwd=self.local_dir,
173173
)
174174

175-
def lfs_track(self, patterns: List[str]):
175+
def lfs_track(self, patterns: Union[str, List[str]]):
176176
"""
177177
Tell git-lfs to track those files.
178178
"""
179+
if isinstance(patterns, str):
180+
patterns = [patterns]
179181
for pattern in patterns:
180182
subprocess.run(
181183
["git", "lfs", "track", pattern], check=True, cwd=self.local_dir

0 commit comments

Comments
 (0)