Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit e4493ca

Browse files
committed
Fix copy/rename bug
1 parent f366cad commit e4493ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

commit_info.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ func (state *getCommitsInfoState) processGitLogOutput(scanner *bufio.Scanner) er
248248
continue
249249
}
250250
if line[0] >= 'A' && line[0] <= 'X' { // a file was changed by the current commit
251-
tabIndex := strings.IndexByte(line, '\t')
251+
// look for the last tab, since for copies (C) and renames (R) two
252+
// filenames are printed: src, then dest
253+
tabIndex := strings.LastIndexByte(line, '\t')
252254
if tabIndex < 1 {
253255
return fmt.Errorf("misformatted line: %s", line)
254256
}

0 commit comments

Comments
 (0)