New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic git fsck command #242
Conversation
if err := verifyCommit(c, opts, CommitID(obj)); err != nil { | ||
addErr(fmt.Errorf("error in commit %v: %v", obj, err)) | ||
} | ||
case "tree": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are tags something that could show up in here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so.. there's a few tag related tests which after the commit ones, so it'll probably come up then. First I need to make it past the t1450.15 test, I think, which keeps having a million other little unrelated things that need to be fixed/supported.
git/fsck.go
Outdated
if strings.Count(pieces[1], ">") > 0 { | ||
return fmt.Errorf("badName: invalid %v line - bad name", typ) | ||
} | ||
//fmt.Printf(`"%v" "%v" "%v"`+"\n", pieces[1], pieces[2], pieces[3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth logging this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be too verbose to log.. it was mostly just for figuring out which parts of the regex need to be greedy to pass the fsck tests.
This adds a skeleton of the git fsck command. It passes the first 15 tests (looking for basic object corruption and verifying commits) from the official test suite.