Skip to content
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

Merged
merged 3 commits into from Mar 24, 2019
Merged

Add basic git fsck command #242

merged 3 commits into from Mar 24, 2019

Conversation

driusan
Copy link
Owner

@driusan driusan commented Mar 19, 2019

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.

if err := verifyCommit(c, opts, CommitID(obj)); err != nil {
addErr(fmt.Errorf("error in commit %v: %v", obj, err))
}
case "tree":
Copy link
Collaborator

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?

Copy link
Owner Author

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])
Copy link
Collaborator

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?

Copy link
Owner Author

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.

@driusan driusan merged commit bfe3c26 into master Mar 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants