Uh oh!
There was an error while loading. Please reload this page.
API, Core: Fix naming in fastForwardBranch/replaceBranch APIs - #9134
Conversation
cc @rakesh-das08@singhpk234 This stems from our discussion on #8854 (comment) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d33430d to
08e41ceCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
08e41ce to
f8a7c24Compare| Preconditions.checkArgument(sourceRef != null, "Ref does not exist: %s", source); | ||
| Preconditions.checkArgument(refToUpdate.isBranch(), "Ref %s is a tag not a branch", name); | ||
| String from, String to, boolean fastForward) { | ||
| Preconditions.checkNotNull(from, "Branch to update cannot be null"); |
There was a problem hiding this comment.
I think we're a little inconsistent here in terms of null checking (throwing NPE vs IAE) but I guess that's out-of-scope for this PR, so just wanted to mention that
There was a problem hiding this comment.
Yeah you're right, and this unfortunately applies to more than just replace/fastForward. (e.g. create, rename, as well throw an NPE instead of IAE). I'll take this in a follow on.
amogh-jahagirdar
commented
Nov 27, 2023
Merging, thanks for the reviews @nastra@rakesh-das08 |
This change fixes some very confusing naming from my original implementation of the fastForward/replaceBranch APIs.
Prior to this change, the APIs had the following naming:
"Name" is the branch that would be fast forwarded and source is the "destination" or target we would fast forward to. This doesn't really align with how most people would think when it comes to fast forward or replace operations (like Git).
This change renames it to:
Note: This is just a rename of parameters and error messages. There is no change in behavior in the API.