Skip to content

Commit

Permalink
Ensure paths are made relative in utils.stage_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Feb 6, 2021
1 parent ba48e3f commit 6961d80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions repo_helper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,13 @@ def stage_changes(
for filename in files:
filename = PathPlus(filename)

if filename.is_absolute():
filename = filename.relative_to(repo.path)

if filename in unstaged_changes or filename in untracked_files:
repo.stage(os.path.normpath(filename))
staged_files.append(filename)

elif (
filename in stat.staged["add"] or filename in stat.staged["modify"]
or filename in stat.staged["delete"]
Expand Down

0 comments on commit 6961d80

Please sign in to comment.