From: Junio C Hamano Date: Sat, 15 Apr 2006 05:19:38 +0000 (-0700) Subject: Fix up default abbrev in setup_revisions() argument parser. X-Git-Tag: v1.4.0-rc1~239^2~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8e8f998739db6526fe890fabc88c866759bc2ac3;p=git.git Fix up default abbrev in setup_revisions() argument parser. The default abbreviation precision should be DEFAULT_ABBREV as before. Signed-off-by: Junio C Hamano --- diff --git a/diff-tree.c b/diff-tree.c index 54157e40d..979f792b6 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -69,6 +69,7 @@ int main(int argc, const char **argv) git_config(git_diff_config); nr_sha1 = 0; + opt->abbrev = 0; argc = setup_revisions(argc, argv, opt, NULL); while (--argc > 0) { diff --git a/git.c b/git.c index 437e9b57d..9d885569d 100644 --- a/git.c +++ b/git.c @@ -286,6 +286,7 @@ static int cmd_log(int argc, const char **argv, char **envp) const char *commit_prefix = "commit "; int shown = 0; + rev.abbrev = DEFAULT_ABBREV; argc = setup_revisions(argc, argv, &rev, "HEAD"); if (argc > 1) die("unrecognized argument: %s", argv[1]); diff --git a/revision.c b/revision.c index 1d26e0d91..bdf8005ae 100644 --- a/revision.c +++ b/revision.c @@ -475,7 +475,12 @@ static void handle_all(struct rev_info *revs, unsigned flags) void init_revisions(struct rev_info *revs) { + unsigned abbrev = revs->abbrev; + memset(revs, 0, sizeof(*revs)); + + revs->abbrev = abbrev; + revs->ignore_merges = 1; revs->pruning.recursive = 1; revs->pruning.add_remove = file_add_remove; revs->pruning.change = file_change;