Closed
Description
Currenly when using vcspull sync
, and a repo has untracked files and no other changes, the command fails with something like
File "/home/jhon/.local/lib/python3.10/site-packages/vcspull/cli/sync.py", line 104, in update_repo
r.update_repo(set_remotes=True) # Creates repo if not exists and fetches
File "/home/jhon/.local/lib/python3.10/site-packages/libvcs/projects/git.py", line 465, in update_repo
self.run(["stash", "pop", "--index", "--quiet"])
File "/home/jhon/.local/lib/python3.10/site-packages/libvcs/projects/base.py", line 154, in run
return run(
File "/home/jhon/.local/lib/python3.10/site-packages/libvcs/cmd/core.py", line 211, in run
raise exc.CommandError(output=output, returncode=code, cmd=cmd)
libvcs.exc.CommandError: Command failed with code 1: git stash pop --index --quiet)
That is because git status
returns output including the untracked files while git stash save
doesn't have the -u
flag and so no stash is actually created.
To fix the problem, one of these should be performed:
- Add
--untracked-files=no
togit status
- Add
--include-untracked
togit stash save
- Check if a stash was actually created before trying to pop