Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory when using modified_unstaged_files #100

Open
angelandy opened this issue Jan 5, 2018 · 0 comments
Open

No such file or directory when using modified_unstaged_files #100

angelandy opened this issue Jan 5, 2018 · 0 comments

Comments

@angelandy
Copy link

print_files('Changes not staged for commit', g.modified_unstaged_files)

File "/usr/local/lib/python2.7/dist-packages/funky/funky.py", line 199, in f
func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/gittle/gittle.py", line 655, in modified_unstaged_files
if os.stat(self.abspath(f)).st_mtime > timestamp
OSError: [Errno 2] No such file or directory: '

if you delete a files at git . and run g.modified_unstaged_files ,that issue will occur:

source code:

    def modified_unstaged_files(self):
        timestamp = self.last_commit.commit_time
        return [
            f
            for f in self.tracked_files
            if os.stat(self.abspath(f)).st_mtime > timestamp
        ]

os.stat(self.abspath(f)).st_mtime > timestamp will catch exception becasue some file has already delete at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant