summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 21d2616)
raw | patch | inline | side by side (parent: 21d2616)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Fri, 1 Apr 2011 09:20:33 +0000 (11:20 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 1 Apr 2011 21:42:31 +0000 (14:42 -0700) |
Currently, "git reflog" overrides some command line options such as
"--format".
Fix this by using the new 2-phase version of cmd_log_init().
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"--format".
Fix this by using the new 2-phase version of cmd_log_init().
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c | patch | blob | history | |
t/t1411-reflog-show.sh | patch | blob | history |
diff --git a/builtin/log.c b/builtin/log.c
index 59fe588559d8955033450fc4feedc2f4ba97af22..9cb5b70d17f05bfa14854161c970ac73cd8ad2e5 100644 (file)
--- a/builtin/log.c
+++ b/builtin/log.c
rev.verbose_header = 1;
memset(&opt, 0, sizeof(opt));
opt.def = "HEAD";
- cmd_log_init(argc, argv, prefix, &rev, &opt);
-
- /*
- * This means that we override whatever commit format the user gave
- * on the cmd line. Sad, but cmd_log_init() currently doesn't
- * allow us to set a different default.
- */
+ cmd_log_init_defaults(&rev);
rev.commit_format = CMIT_FMT_ONELINE;
rev.use_terminator = 1;
rev.always_show_header = 1;
+ cmd_log_init_finish(argc, argv, prefix, &rev, &opt);
return cmd_log_walk(&rev);
}
diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh
index 88dc6a781bad529b2460ae0295ad1f6bf0e0d0c7..caa687b5b46cea65ed16c70c29cc11e9e8b771f1 100755 (executable)
--- a/t/t1411-reflog-show.sh
+++ b/t/t1411-reflog-show.sh
one
EOF
-test_expect_failure 'override reflog default format' '
+test_expect_success 'override reflog default format' '
git reflog --format=short -1 >actual &&
test_cmp expect actual
'