Sync with 2.0.2

* maint:
  Git 2.0.2
  annotate: use argv_array
This commit is contained in:
Junio C Hamano 2014-07-16 11:48:16 -07:00
commit f2c9f21369
3 changed files with 26 additions and 8 deletions

View file

@ -11,3 +11,22 @@ Git v2.0.2 Release Notes
* Recent updates to "git repack" started to duplicate objects that
are in packfiles marked with .keep flag into the new packfile by
mistake.
* "git clone -b brefs/tags/bar" would have mistakenly thought we were
following a single tag, even though it was a name of the branch,
because it incorrectly used strstr().
* "%G" (nothing after G) is an invalid pretty format specifier, but
the parser did not notice it as garbage.
* Code to avoid adding the same alternate object store twice was
subtly broken for a long time, but nobody seems to have noticed.
* A handful of code paths had to read the commit object more than
once when showing header fields that are usually not parsed. The
internal data structure to keep track of the contents of the commit
object has been updated to reduce the need for this double-reading,
and to allow the caller find the length of the object.
* During "git rebase --merge", a conflicted patch could not be
skipped with "--skip" if the next one also conflicted.

View file

@ -43,9 +43,10 @@ unreleased) version of Git, that is available from the 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:
* link:v2.0.1/git.html[documentation for release 2.0.1]
* link:v2.0.2/git.html[documentation for release 2.0.2]
* release notes for
link:RelNotes/2.0.2.txt[2.0.2],
link:RelNotes/2.0.1.txt[2.0.1],
link:RelNotes/2.0.0.txt[2.0.0].

View file

@ -5,20 +5,18 @@
*/
#include "git-compat-util.h"
#include "builtin.h"
#include "argv-array.h"
int cmd_annotate(int argc, const char **argv, const char *prefix)
{
const char **nargv;
struct argv_array args = ARGV_ARRAY_INIT;
int i;
nargv = xmalloc(sizeof(char *) * (argc + 2));
nargv[0] = "annotate";
nargv[1] = "-c";
argv_array_pushl(&args, "annotate", "-c", NULL);
for (i = 1; i < argc; i++) {
nargv[i+1] = argv[i];
argv_array_push(&args, argv[i]);
}
nargv[argc + 1] = NULL;
return cmd_blame(argc + 1, nargv, prefix);
return cmd_blame(args.argc, args.argv, prefix);
}