Skip to content

Commit

Permalink
Merge branch 'zk/log-graph-showsig' into maint
Browse files Browse the repository at this point in the history
* zk/log-graph-showsig:
  log: fix indentation for --graph --show-signature
  • Loading branch information
Junio C Hamano committed Jul 22, 2014
2 parents 514dd21 + cf3983d commit a1991f1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ static void show_sig_lines(struct rev_info *opt, int status, const char *bol)
eol = strchrnul(bol, '\n');
printf("%s%.*s%s%s", color, (int)(eol - bol), bol, reset,
*eol ? "\n" : "");
graph_show_oneline(opt->graph);
bol = (*eol) ? (eol + 1) : eol;
}
}
Expand Down
31 changes: 31 additions & 0 deletions t/t4202-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
test_description='git log'

. ./test-lib.sh
. "$TEST_DIRECTORY/lib-gpg.sh"

test_expect_success setup '
Expand Down Expand Up @@ -841,4 +842,34 @@ test_expect_success 'dotdot is a parent directory' '
test_cmp expect actual
'

test_expect_success GPG 'log --graph --show-signature' '
test_when_finished "git reset --hard && git checkout master" &&
git checkout -b signed master &&
echo foo >foo &&
git add foo &&
git commit -S -m signed_commit &&
git log --graph --show-signature -n1 signed >actual &&
grep "^| gpg: Signature made" actual &&
grep "^| gpg: Good signature" actual
'

test_expect_success GPG 'log --graph --show-signature for merged tag' '
test_when_finished "git reset --hard && git checkout master" &&
git checkout -b plain master &&
echo aaa >bar &&
git add bar &&
git commit -m bar_commit &&
git checkout -b tagged master &&
echo bbb >baz &&
git add baz &&
git commit -m baz_commit &&
git tag -s -m signed_tag_msg signed_tag &&
git checkout plain &&
git merge --no-ff -m msg signed_tag &&
git log --graph --show-signature -n1 plain >actual &&
grep "^|\\\ merged tag" actual &&
grep "^| | gpg: Signature made" actual &&
grep "^| | gpg: Good signature" actual
'

test_done

0 comments on commit a1991f1

Please sign in to comment.