Git 1.7.0-rc0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAktc+YwACgkQwMbZpPMRm5q1jQCglSm5AgkFn6veNguepIBSlOgr
1doAoIvMToMqXc+NFLNw1oAxlMKYmg6g
=i7tm
-----END PGP SIGNATURE-----
gitweb.js: Workaround for IE8 bug

In Internet Explorer 8 (IE8) the 'blame_incremental' view, which uses
JavaScript to generate blame info using AJAX, sometimes hang at the
beginning (at 0%) of blaming, e.g. for larger files with long history
like git's own gitweb/gitweb.perl.

The error shown by JavaScript console is "Unspecified error" at char:2
of the following line in gitweb/gitweb.js:

  if (xhr.readyState === 3 && xhr.status !== 200) {

Debugging it using IE8 JScript debuger shown that the error occurs
when trying to access xhr.status (xhr is XMLHttpRequest object).
Watch for xhr object shows 'Unspecified error.' as "value" of
xhr.status, and trying to access xhr.status from console throws error.

This bug is some intermittent bug, depending on XMLHttpRequest timing,
as it doesn't occur in all cases.  It is probably caused by the fact
that handleResponse is called from timer (pollTimer), to work around
the fact that some browsers call onreadystatechange handler only once
for each state change, and not like required for 'blame_incremental'
as soon as new data is available from server.  It looks like xhr
object is not properly initialized; still it is a bug to throw an
error when accessing xhr.status (and not use 'null' or 'undefined' as
value).

Work around this bug in IE8 by using try-catch block when accessing
xhr.status.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 file changed
tree: ae0a1347bfeb92c2e627dd6ecb3d41a821147c71
  1. .gitattributes
  2. .gitignore
  3. .mailmap
  4. COPYING
  5. Documentation/
  6. GIT-VERSION-GEN
  7. INSTALL
  8. Makefile
  9. README
  10. abspath.c
  11. advice.c
  12. advice.h
  13. alias.c
  14. alloc.c
  15. archive-tar.c
  16. archive-zip.c
  17. archive.c
  18. archive.h
  19. attr.c
  20. attr.h
  21. base85.c
  22. bisect.c
  23. bisect.h
  24. blob.c
  25. blob.h
  26. block-sha1/
  27. branch.c
  28. branch.h
  29. builtin-add.c
  30. builtin-annotate.c
  31. builtin-apply.c
  32. builtin-archive.c
  33. builtin-bisect--helper.c
  34. builtin-blame.c
  35. builtin-branch.c
  36. builtin-bundle.c
  37. builtin-cat-file.c
  38. builtin-check-attr.c
  39. builtin-check-ref-format.c
  40. builtin-checkout-index.c
  41. builtin-checkout.c
  42. builtin-clean.c
  43. builtin-clone.c
  44. builtin-commit-tree.c
  45. builtin-commit.c
  46. builtin-config.c
  47. builtin-count-objects.c
  48. builtin-describe.c
  49. builtin-diff-files.c
  50. builtin-diff-index.c
  51. builtin-diff-tree.c
  52. builtin-diff.c
  53. builtin-fast-export.c
  54. builtin-fetch-pack.c
  55. builtin-fetch.c
  56. builtin-fmt-merge-msg.c
  57. builtin-for-each-ref.c
  58. builtin-fsck.c
  59. builtin-gc.c
  60. builtin-grep.c
  61. builtin-hash-object.c
  62. builtin-help.c
  63. builtin-index-pack.c
  64. builtin-init-db.c
  65. builtin-log.c
  66. builtin-ls-files.c
  67. builtin-ls-remote.c
  68. builtin-ls-tree.c
  69. builtin-mailinfo.c
  70. builtin-mailsplit.c
  71. builtin-merge-base.c
  72. builtin-merge-file.c
  73. builtin-merge-index.c
  74. builtin-merge-ours.c
  75. builtin-merge-recursive.c
  76. builtin-merge-tree.c
  77. builtin-merge.c
  78. builtin-mktag.c
  79. builtin-mktree.c
  80. builtin-mv.c
  81. builtin-name-rev.c
  82. builtin-pack-objects.c
  83. builtin-pack-redundant.c
  84. builtin-pack-refs.c
  85. builtin-patch-id.c
  86. builtin-prune-packed.c
  87. builtin-prune.c
  88. builtin-push.c
  89. builtin-read-tree.c
  90. builtin-receive-pack.c
  91. builtin-reflog.c
  92. builtin-remote.c
  93. builtin-replace.c
  94. builtin-rerere.c
  95. builtin-reset.c
  96. builtin-rev-list.c
  97. builtin-rev-parse.c
  98. builtin-revert.c
  99. builtin-rm.c
  100. builtin-send-pack.c
  101. builtin-shortlog.c
  102. builtin-show-branch.c
  103. builtin-show-ref.c
  104. builtin-stripspace.c
  105. builtin-symbolic-ref.c
  106. builtin-tag.c
  107. builtin-tar-tree.c
  108. builtin-unpack-file.c
  109. builtin-unpack-objects.c
  110. builtin-update-index.c
  111. builtin-update-ref.c
  112. builtin-update-server-info.c
  113. builtin-upload-archive.c
  114. builtin-var.c
  115. builtin-verify-pack.c
  116. builtin-verify-tag.c
  117. builtin-write-tree.c
  118. builtin.h
  119. bundle.c
  120. bundle.h
  121. cache-tree.c
  122. cache-tree.h
  123. cache.h
  124. check-builtins.sh
  125. check-racy.c
  126. check_bindir
  127. color.c
  128. color.h
  129. combine-diff.c
  130. command-list.txt
  131. commit.c
  132. commit.h
  133. compat/
  134. config.c
  135. config.mak.in
  136. configure.ac
  137. connect.c
  138. contrib/
  139. convert.c
  140. copy.c
  141. csum-file.c
  142. csum-file.h
  143. ctype.c
  144. daemon.c
  145. date.c
  146. decorate.c
  147. decorate.h
  148. delta.h
  149. diff-delta.c
  150. diff-lib.c
  151. diff-no-index.c
  152. diff.c
  153. diff.h
  154. diffcore-break.c
  155. diffcore-delta.c
  156. diffcore-order.c
  157. diffcore-pickaxe.c
  158. diffcore-rename.c
  159. diffcore.h
  160. dir.c
  161. dir.h
  162. editor.c
  163. entry.c
  164. environment.c
  165. exec_cmd.c
  166. exec_cmd.h
  167. fast-import.c
  168. fetch-pack.h
  169. fixup-builtins
  170. fsck.c
  171. fsck.h
  172. generate-cmdlist.sh
  173. git-add--interactive.perl
  174. git-am.sh
  175. git-archimport.perl
  176. git-bisect.sh
  177. git-compat-util.h
  178. git-cvsexportcommit.perl
  179. git-cvsimport.perl
  180. git-cvsserver.perl
  181. git-difftool--helper.sh
  182. git-difftool.perl
  183. git-filter-branch.sh
  184. git-gui/
  185. git-instaweb.sh
  186. git-lost-found.sh
  187. git-merge-octopus.sh
  188. git-merge-one-file.sh
  189. git-merge-resolve.sh
  190. git-mergetool--lib.sh
  191. git-mergetool.sh
  192. git-notes.sh
  193. git-parse-remote.sh
  194. git-pull.sh
  195. git-quiltimport.sh
  196. git-rebase--interactive.sh
  197. git-rebase.sh
  198. git-relink.perl
  199. git-repack.sh
  200. git-request-pull.sh
  201. git-send-email.perl
  202. git-sh-setup.sh
  203. git-stash.sh
  204. git-submodule.sh
  205. git-svn.perl
  206. git-web--browse.sh
  207. git.c
  208. git.spec.in
  209. git_remote_helpers/
  210. gitk-git/
  211. gitweb/
  212. graph.c
  213. graph.h
  214. grep.c
  215. grep.h
  216. hash.c
  217. hash.h
  218. help.c
  219. help.h
  220. hex.c
  221. http-backend.c
  222. http-fetch.c
  223. http-push.c
  224. http-walker.c
  225. http.c
  226. http.h
  227. ident.c
  228. imap-send.c
  229. levenshtein.c
  230. levenshtein.h
  231. list-objects.c
  232. list-objects.h
  233. ll-merge.c
  234. ll-merge.h
  235. lockfile.c
  236. log-tree.c
  237. log-tree.h
  238. mailmap.c
  239. mailmap.h
  240. match-trees.c
  241. merge-file.c
  242. merge-recursive.c
  243. merge-recursive.h
  244. name-hash.c
  245. notes.c
  246. notes.h
  247. object.c
  248. object.h
  249. pack-check.c
  250. pack-refs.c
  251. pack-refs.h
  252. pack-revindex.c
  253. pack-revindex.h
  254. pack-write.c
  255. pack.h
  256. pager.c
  257. parse-options.c
  258. parse-options.h
  259. patch-delta.c
  260. patch-ids.c
  261. patch-ids.h
  262. path.c
  263. perl/
  264. pkt-line.c
  265. pkt-line.h
  266. ppc/
  267. preload-index.c
  268. pretty.c
  269. progress.c
  270. progress.h
  271. quote.c
  272. quote.h
  273. reachable.c
  274. reachable.h
  275. read-cache.c
  276. reflog-walk.c
  277. reflog-walk.h
  278. refs.c
  279. refs.h
  280. remote-curl.c
  281. remote.c
  282. remote.h
  283. replace_object.c
  284. rerere.c
  285. rerere.h
  286. resolve-undo.c
  287. resolve-undo.h
  288. revision.c
  289. revision.h
  290. run-command.c
  291. run-command.h
  292. send-pack.h
  293. server-info.c
  294. setup.c
  295. sha1-lookup.c
  296. sha1-lookup.h
  297. sha1_file.c
  298. sha1_name.c
  299. shallow.c
  300. shell.c
  301. shortlog.h
  302. show-index.c
  303. sideband.c
  304. sideband.h
  305. sigchain.c
  306. sigchain.h
  307. strbuf.c
  308. strbuf.h
  309. string-list.c
  310. string-list.h
  311. submodule.c
  312. submodule.h
  313. symlinks.c
  314. t/
  315. tag.c
  316. tag.h
  317. tar.h
  318. templates/
  319. test-chmtime.c
  320. test-ctype.c
  321. test-date.c
  322. test-delta.c
  323. test-dump-cache-tree.c
  324. test-genrandom.c
  325. test-index-version.c
  326. test-match-trees.c
  327. test-parse-options.c
  328. test-path-utils.c
  329. test-run-command.c
  330. test-sha1.c
  331. test-sha1.sh
  332. test-sigchain.c
  333. thread-utils.c
  334. thread-utils.h
  335. trace.c
  336. transport-helper.c
  337. transport.c
  338. transport.h
  339. tree-diff.c
  340. tree-walk.c
  341. tree-walk.h
  342. tree.c
  343. tree.h
  344. unimplemented.sh
  345. unpack-trees.c
  346. unpack-trees.h
  347. upload-pack.c
  348. usage.c
  349. userdiff.c
  350. userdiff.h
  351. utf8.c
  352. utf8.h
  353. walker.c
  354. walker.h
  355. wrap-for-bin.sh
  356. wrapper.c
  357. write_or_die.c
  358. ws.c
  359. wt-status.c
  360. wt-status.h
  361. xdiff-interface.c
  362. xdiff-interface.h
  363. xdiff/