Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
Parsing improvements to FileHashesFromRef
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Waugh <[email protected]>
  • Loading branch information
twaugh committed Sep 20, 2018
1 parent cd281e0 commit 3a3d719
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions backvendor/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,10 @@ func (g *gitWorkingTree) FileHashesFromRef(ref string) (*FileHashes, error) {
for scanner.Scan() {
line := scanner.Text()
fields := strings.Fields(line)
if len(fields) < 4 {
if len(fields) != 4 {
return nil, fmt.Errorf("line not understood: %s", line)
}

var mode uint32
if _, err = fmt.Sscanf(fields[0], "%o", &mode); err != nil {
return nil, err
}
fh[fields[3]] = FileHash(fields[2])
}

Expand Down

0 comments on commit 3a3d719

Please sign in to comment.