src-d / go-git

Project has been moved to: https://github.com/go-git/go-git
https://github.com/go-git/go-git
Apache License 2.0
4.91k stars 541 forks source link

Is there a way to find out the last modified date of a file within a commit #1242

Open felixbecker opened 4 years ago

felixbecker commented 4 years ago

Hi,

giving I have a repository with a bunch of files. When I use the library to clone the repo and run over the commits to get the latest and then extract all the files. Is there a way to get the last modified date of the file? Right now I do only see

 type File struct{
   Name string
   Mode filemode.FileMode
   Blob
}

The commit date does not help because it would be the same for all files? Is there another way to get the last modified date from a file object?