richardmaw-codethink pushed to branch richardmaw/oldgit-shallow-parents-exclude-fix at BuildStream / buildstream
Commits:
-
b6f7ad3a
by Richard Maw at 2019-01-14T16:00:29Z
1 changed file:
Changes:
| ... | ... | @@ -869,14 +869,17 @@ def test_git_describe(cli, tmpdir, datafiles, ref_storage, tag_type): |
| 869 | 869 |
cwd=checkout).decode('ascii')
|
| 870 | 870 |
assert describe.startswith('tag2-2-')
|
| 871 | 871 |
|
| 872 |
- describe_fp = subprocess.check_output(['git', 'describe', '--first-parent'] + options,
|
|
| 873 |
- cwd=checkout).decode('ascii')
|
|
| 874 |
- assert describe_fp.startswith('tag1-2-')
|
|
| 872 |
+ exit_code, out = subprocess.check_output(['git', 'describe', '--first-parent'] + options,
|
|
| 873 |
+ cwd=checkout)
|
|
| 874 |
+ has_first_parent == exit_code == 0
|
|
| 875 |
+ if has_first_parent:
|
|
| 876 |
+ describe_fp = out.decode('ascii')
|
|
| 877 |
+ assert describe_fp.startswith('tag1-2-')
|
|
| 875 | 878 |
|
| 876 | 879 |
tags = subprocess.check_output(['git', 'tag'],
|
| 877 | 880 |
cwd=checkout).decode('ascii')
|
| 878 | 881 |
tags = set(tags.splitlines())
|
| 879 |
- assert tags == set(['tag1', 'tag2'])
|
|
| 882 |
+ assert tags == set(['tag1', 'tag2']) if has_first_parent else set(['tag2'])
|
|
| 880 | 883 |
|
| 881 | 884 |
p = subprocess.run(['git', 'log', repo.rev_parse('uselesstag')],
|
| 882 | 885 |
cwd=checkout)
|
