Introduce new pretty formats %g[sdD] for reflog information
[gitweb.git] / t / t6006-rev-list-format.sh
index 59d1f6283bec5cf7740d988dfd090c1463389c71..7f61ab0e522fd28c5e10594f03ed9076f9f5ce42 100755 (executable)
@@ -162,4 +162,22 @@ test_expect_success 'empty email' '
        }
 '
 
+test_expect_success '"%h %gD: %gs" is same as git-reflog' '
+       git reflog >expect &&
+       git log -g --format="%h %gD: %gs" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success '"%h %gD: %gs" is same as git-reflog (with date)' '
+       git reflog --date=raw >expect &&
+       git log -g --format="%h %gD: %gs" --date=raw >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success '%gd shortens ref name' '
+       echo "master@{0}" >expect.gd-short &&
+       git log -g -1 --format=%gd refs/heads/master >actual.gd-short &&
+       test_cmp expect.gd-short actual.gd-short
+'
+
 test_done