diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2013-09-03 10:07:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-03 12:55:30 -0700 |
commit | c812be9d81cf1fc587695d985bced50258b53d31 (patch) | |
tree | 1b1eb1a219314f635b1bfa30f7550c75d5f15a47 /compat | |
parent | d8f7681337dd0c7944ba2293a72952110977077d (diff) | |
download | git-c812be9d81cf1fc587695d985bced50258b53d31.tar.gz |
rev-parse test: use test_cmp instead of "test" builtin
Use test_cmp instead of passing two command substitutions to the
"test" builtin. This way:
- when tests fail, they can print a helpful diff if run with
"--verbose"
- the argument order "test_cmp expect actual" feels natural,
unlike test <known> = <unknown> that seems backwards
- the exit status from invoking git is checked, so if rev-parse
starts segfaulting then the test will notice and fail
Use a custom function for this instead of test_cmp_rev to emphasize
that we are testing the output from "git rev-parse" with certain
arguments, not checking that the revisions are equal in abstract.
Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
0 files changed, 0 insertions, 0 deletions