Fix error handling for nonexistent names

When passing in a pathname pattern without the "--" separator on the
command line, we verify that the pathnames in question exist. However,
there were two bugs in that verification:

 - git-rev-parse would only check the first pathname, and silently allow
   any invalid subsequent pathname, whether it existed or not (which
   defeats the purpose of the check, and is also inconsistent with what
   git-rev-list actually does)

 - git-rev-list (and "git log" etc) would check each filename, but if the
   check failed, it would print the error using the first one, i.e.:

	[torvalds@g5 git]$ git log Makefile bad-file
	fatal: 'Makefile': No such file or directory

   instead of saying that it's 'bad-file' that doesn't exist.

This fixes both bugs.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2 files changed
tree: da2f0dfbeba9118205ab90ae6057952e0dae32c8
  1. arm/
  2. compat/
  3. contrib/
  4. Documentation/
  5. mozilla-sha1/
  6. ppc/
  7. t/
  8. templates/
  9. .gitignore
  10. apply.c
  11. blame.c
  12. blob.c
  13. blob.h
  14. cache.h
  15. cat-file.c
  16. check-ref-format.c
  17. checkout-index.c
  18. clone-pack.c
  19. combine-diff.c
  20. commit-tree.c
  21. commit.c
  22. commit.h
  23. config.c
  24. connect.c
  25. convert-objects.c
  26. copy.c
  27. COPYING
  28. count-delta.c
  29. count-delta.h
  30. csum-file.c
  31. csum-file.h
  32. ctype.c
  33. daemon.c
  34. date.c
  35. delta.h
  36. describe.c
  37. diff-delta.c
  38. diff-files.c
  39. diff-index.c
  40. diff-stages.c
  41. diff-tree.c
  42. diff.c
  43. diff.h
  44. diffcore-break.c
  45. diffcore-delta.c
  46. diffcore-order.c
  47. diffcore-pathspec.c
  48. diffcore-pickaxe.c
  49. diffcore-rename.c
  50. diffcore.h
  51. entry.c
  52. environment.c
  53. exec_cmd.c
  54. exec_cmd.h
  55. fetch-clone.c
  56. fetch-pack.c
  57. fetch.c
  58. fetch.h
  59. fsck-objects.c
  60. generate-cmdlist.sh
  61. get-tar-commit-id.c
  62. git-add.sh
  63. git-am.sh
  64. git-annotate.perl
  65. git-applymbox.sh
  66. git-applypatch.sh
  67. git-archimport.perl
  68. git-bisect.sh
  69. git-branch.sh
  70. git-checkout.sh
  71. git-cherry.sh
  72. git-clone.sh
  73. git-commit.sh
  74. git-compat-util.h
  75. git-count-objects.sh
  76. git-cvsexportcommit.perl
  77. git-cvsimport.perl
  78. git-cvsserver.perl
  79. git-diff.sh
  80. git-fetch.sh
  81. git-fmt-merge-msg.perl
  82. git-format-patch.sh
  83. git-grep.sh
  84. git-log.sh
  85. git-lost-found.sh
  86. git-ls-remote.sh
  87. git-merge-octopus.sh
  88. git-merge-one-file.sh
  89. git-merge-ours.sh
  90. git-merge-recursive.py
  91. git-merge-resolve.sh
  92. git-merge-stupid.sh
  93. git-merge.sh
  94. git-mv.perl
  95. git-parse-remote.sh
  96. git-prune.sh
  97. git-pull.sh
  98. git-push.sh
  99. git-rebase.sh
  100. git-relink.perl
  101. git-repack.sh
  102. git-request-pull.sh
  103. git-rerere.perl
  104. git-reset.sh
  105. git-resolve.sh
  106. git-revert.sh
  107. git-rm.sh
  108. git-send-email.perl
  109. git-sh-setup.sh
  110. git-shortlog.perl
  111. git-svnimport.perl
  112. git-tag.sh
  113. git-verify-tag.sh
  114. GIT-VERSION-GEN
  115. git-whatchanged.sh
  116. git.c
  117. git.spec.in
  118. gitk
  119. gitMergeCommon.py
  120. hash-object.c
  121. http-fetch.c
  122. http-push.c
  123. http.c
  124. http.h
  125. ident.c
  126. imap-send.c
  127. index-pack.c
  128. index.c
  129. init-db.c
  130. INSTALL
  131. local-fetch.c
  132. ls-files.c
  133. ls-tree.c
  134. mailinfo.c
  135. mailsplit.c
  136. Makefile
  137. merge-base.c
  138. merge-index.c
  139. merge-tree.c
  140. mktag.c
  141. mktree.c
  142. name-rev.c
  143. object.c
  144. object.h
  145. pack-check.c
  146. pack-objects.c
  147. pack-redundant.c
  148. pack.h
  149. pager.c
  150. patch-delta.c
  151. patch-id.c
  152. path.c
  153. peek-remote.c
  154. pkt-line.c
  155. pkt-line.h
  156. prune-packed.c
  157. quote.c
  158. quote.h
  159. read-cache.c
  160. read-tree.c
  161. README
  162. receive-pack.c
  163. refs.c
  164. refs.h
  165. repo-config.c
  166. rev-list.c
  167. rev-parse.c
  168. revision.c
  169. revision.h
  170. rsh.c
  171. rsh.h
  172. run-command.c
  173. run-command.h
  174. send-pack.c
  175. server-info.c
  176. setup.c
  177. sha1_file.c
  178. sha1_name.c
  179. shell.c
  180. show-branch.c
  181. show-index.c
  182. ssh-fetch.c
  183. ssh-pull.c
  184. ssh-push.c
  185. ssh-upload.c
  186. strbuf.c
  187. strbuf.h
  188. stripspace.c
  189. symbolic-ref.c
  190. tag.c
  191. tag.h
  192. tar-tree.c
  193. test-date.c
  194. test-delta.c
  195. tree-diff.c
  196. tree.c
  197. tree.h
  198. unpack-file.c
  199. unpack-objects.c
  200. update-index.c
  201. update-ref.c
  202. update-server-info.c
  203. upload-pack.c
  204. usage.c
  205. var.c
  206. verify-pack.c
  207. write-tree.c