Commit 4170f79
committed
Forward
Currently if I run a workflow where the parent commit cannot be found in
the destination (with merge_import from
[here](c54a5b9)
off), I get an exception:
```
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:148)
at com.google.copybara.WorkflowMode$3.run(WorkflowMode.java:261)
at com.google.copybara.Workflow.run(Workflow.java:288)
at com.google.copybara.MigrateCmd.run(MigrateCmd.java:92)
at com.google.copybara.MigrateCmd.run(MigrateCmd.java:69)
at com.google.copybara.Main.runInternal(Main.java:241)
at com.google.copybara.Main.run(Main.java:123)
at com.google.copybara.Main.main(Main.java:102)
ERROR: Unexpected error (please file a bug against copybara): No value present (java.util.NoSuchElementException: No value present)
```
I think the right thing to do here is convert the empty `Optional` to
`null`? In which case I a legitimate error message instead of a crash:
```
ERROR: Cannot find matching parent commit in the destination. Use '--change-request-parent' flag to force a parent commit to use as baseline in the destination.
```
Definitely not 100% sure this fix is correct though, this is as much a
bug report as it is a proposed fix.
Topic: copybara-null-baselinenull when parent cannot be found1 parent f7d7714 commit 4170f79
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
0 commit comments