Skip to content

Commit

Permalink
Fix up default abbrev in setup_revisions() argument parser.
Browse files Browse the repository at this point in the history
The default abbreviation precision should be DEFAULT_ABBREV as before.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Apr 15, 2006
1 parent cd2bdc5 commit 8e8f998
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
5 changes: 5 additions & 0 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e8f998

Please sign in to comment.