Skip to content

Commit 0cba834

Browse files
authored
Merge pull request codecov#238 from codecov/fix-||
fixed errors with or symbols
2 parents c526ffa + 2a1e0c8 commit 0cba834

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

codecov/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,9 @@ def main(*argv, **kwargs):
547547
if not query.get('branch'):
548548
try:
549549
# find branch, commit, repo from git command
550-
branch = try_to_run(
551-
['git', 'rev-parse', '--abbrev-ref', 'HEAD', '||', 'hg branch'])
550+
branch = (try_to_run(
551+
['git', 'rev-parse', '--abbrev-ref', 'HEAD']) or try_to_run(
552+
['hg', 'branch']))
552553
query['branch'] = branch if branch != 'HEAD' else ''
553554
write(' -> Got branch from git/hg')
554555

@@ -557,8 +558,9 @@ def main(*argv, **kwargs):
557558

558559
if not query.get('commit'):
559560
try:
560-
query['commit'] = try_to_run(
561-
["git", "rev-parse", "HEAD", "||", "hg", "id", "-i", "--debug", "|", "tr", "-d", "'+'"])
561+
query['commit'] = (try_to_run(
562+
['git', 'rev-parse', "HEAD"]) or try_to_run(
563+
["hg", "id", "-i", "--debug", '|', "tr", "-d", "'+'"]))
562564
write(' -> Got sha from git/hg')
563565

564566
except: # pragma: no cover

0 commit comments

Comments
 (0)