Skip to content

No such file or directory when using modified_unstaged_files  #100

@angelandy

Description

@angelandy
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions