@@ -49,6 +49,7 @@ pub struct Commit {
4949 pub body : String ,
5050 pub parent_commit_hashes : Vec < CommitHash > ,
5151 pub commit_type : CommitType ,
52+ pub line_number : usize ,
5253}
5354
5455#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord ) ]
@@ -267,7 +268,7 @@ fn load_all_commits(path: &Path, sort: SortCommit, stashes: &[Commit]) -> Vec<Co
267268
268269 let mut commits = Vec :: new ( ) ;
269270
270- for bytes in reader. split ( b'\0' ) {
271+ for ( i , bytes) in reader. split ( b'\0' ) . enumerate ( ) {
271272 let bytes = bytes. unwrap ( ) ;
272273 let s = String :: from_utf8_lossy ( & bytes) ;
273274
@@ -288,6 +289,7 @@ fn load_all_commits(path: &Path, sort: SortCommit, stashes: &[Commit]) -> Vec<Co
288289 body : parts[ 8 ] . into ( ) ,
289290 parent_commit_hashes : parse_parent_commit_hashes ( parts[ 9 ] ) ,
290291 commit_type : CommitType :: Commit ,
292+ line_number : i,
291293 } ;
292294
293295 commits. push ( commit) ;
@@ -316,7 +318,7 @@ fn load_all_stashes(path: &Path) -> Vec<Commit> {
316318
317319 let mut commits = Vec :: new ( ) ;
318320
319- for bytes in reader. split ( b'\0' ) {
321+ for ( i , bytes) in reader. split ( b'\0' ) . enumerate ( ) {
320322 let bytes = bytes. unwrap ( ) ;
321323 let s = String :: from_utf8_lossy ( & bytes) ;
322324
@@ -337,6 +339,7 @@ fn load_all_stashes(path: &Path) -> Vec<Commit> {
337339 body : parts[ 8 ] . into ( ) ,
338340 parent_commit_hashes : parse_parent_commit_hashes ( parts[ 9 ] ) ,
339341 commit_type : CommitType :: Stash ,
342+ line_number : i,
340343 } ;
341344
342345 commits. push ( commit) ;
0 commit comments