-
-
Notifications
You must be signed in to change notification settings - Fork 540
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 --single-branch
flag for dolt clone
#7088
Conversation
if brnch.GetPath() != branch { | ||
err := dEnv.DoltDB.DeleteBranch(ctx, brnch, nil) | ||
if err != nil { | ||
return fmt.Errorf("%w: %s; %s", ErrFailedToDeleteBranch, brnch.String(), err.Error()) | ||
} | ||
} else if !singleBranch || brnch.GetPath() == branch { |
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.
The only way you can reach this conditional is if the branches are equal (because we checked for inequality in the first conditional), so this block will always be entered regardless of the singleBranch flag, because anything || TRUE
is always true.
You can convince me this is right if you can point me to tests which verify the remote tracking branches work without the --single-branch (or write a test for that if we don't have one).
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.
Ship when the nit we talked about is resolved and the tests continue to pass.
if err != nil { | ||
return fmt.Errorf("%w: %s; %s", ErrFailedToResolveBranchRef, brnch.String(), err.Error()) | ||
for _, br := range branches { | ||
if !singleBranch || (singleBranch && br.GetPath() == branch) { |
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.
small logical redundancy we talked about.
Adds
--single-branch
flag fordolt clone
to match git behavior more closely.Fixes: #3873