================
@@ -153,8 +157,13 @@ def main():
   else:
     if len(commits) > 2:
       die('at most two commits allowed; %d given' % len(commits))
+  if len(commits) < 2 and opts.diff_from_common_commit:
+    die('--diff_from_common_commit is only allowed when two commits are given')
----------------
owenca wrote:

Let's fix the unreachable line 159 above while we are at it:
```suggestion
  if len(commits) > 2:
    die('at most two commits allowed; %d given' % len(commits))
  if len(commits) == 2:
    if opts.staged:
      die('--staged is not allowed when two commits are given')
    if not opts.diff:
      die('--diff is required when two commits are given')
  elif opts.diff_from_common_commit:
    die('--diff_from_common_commit is only allowed when two commits are given')
```

https://github.com/llvm/llvm-project/pull/74230
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to