|
1 | 1 | ###################################################################################################
|
2 |
| -# Copyright (C) 2021 Maxim Integrated Products, Inc. All Rights Reserved. |
| 2 | +# Copyright (C) 2021-2022 Maxim Integrated Products, Inc. All Rights Reserved. |
3 | 3 | #
|
4 | 4 | # Maxim Integrated Products, Inc. Default Copyright Notice:
|
5 | 5 | # https://www.maximintegrated.com/en/aboutus/legal/copyrights.html
|
@@ -37,15 +37,19 @@ def check_repo(
|
37 | 37 | wprint('Cannot check for updates - no local repository.')
|
38 | 38 | return False
|
39 | 39 |
|
40 |
| - localrepo = git.Repo.init(folder) |
41 |
| - active_branch = localrepo.active_branch |
42 |
| - if verbose: |
43 |
| - print('Active branch:', active_branch, "(dirty)" if localrepo.is_dirty() else "") |
| 40 | + try: |
| 41 | + localrepo = git.Repo.init(folder) |
| 42 | + active_branch = localrepo.active_branch |
| 43 | + if verbose: |
| 44 | + print('Active branch:', active_branch, "(dirty)" if localrepo.is_dirty() else "") |
44 | 45 |
|
45 |
| - localhead = localrepo.head.commit.hexsha |
46 |
| - localdate = datetime.datetime.utcfromtimestamp(localrepo.head.commit.committed_date) |
47 |
| - if verbose: |
48 |
| - print('LOCAL ', localhead, localdate) |
| 46 | + localhead = localrepo.head.commit.hexsha |
| 47 | + localdate = datetime.datetime.utcfromtimestamp(localrepo.head.commit.committed_date) |
| 48 | + if verbose: |
| 49 | + print('LOCAL ', localhead, localdate) |
| 50 | + except ValueError as exc: |
| 51 | + wprint('Cannot check for updates from GitHub -', str(exc)) |
| 52 | + return False |
49 | 53 |
|
50 | 54 | retval = False
|
51 | 55 | g = github.Github()
|
|
0 commit comments