Fix nasty approxidate bug

Stupid me.

If approxidate ends up with a month that is ahead of the current month, it
decrements the year to last year.

Which is correct, and means that "last december" does the right thing.

HOWEVER. It should only do so if the year is the same as the current year.

Without this fix, "5 days ago" ends up being in 2004, because it first
decrements five days, getting us to December 2005 (correct), but then it
also ends up decrementing the year once more to turn that December into
"last year" (incorrect, since it already _was_ last year).

Duh. Pass me a donut.

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