Fix git-format-patch -s to include a Signed-off-by: line...
[git.git] / rev-list.c
index 8020d97..e00e6fc 100644 (file)
@@ -844,13 +844,18 @@ int main(int argc, const char **argv)
                        arg++;
                        limited = 1;
                }
-               if (get_sha1(arg, sha1) < 0)
+               if (get_sha1(arg, sha1) < 0) {
+                       struct stat st;
+                       if (lstat(arg, &st) < 0)
+                               die("'%s': %s", arg, strerror(errno));
                        break;
+               }
                commit = get_commit_reference(arg, sha1, flags);
                handle_one_commit(commit, &list);
        }
 
-       if (!list)
+       if (!list &&
+           (!(tag_objects||tree_objects||blob_objects) && !pending_objects))
                usage(rev_list_usage);
 
        paths = get_pathspec(prefix, argv + i);