File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -342,10 +342,11 @@ def _update_scm_info(self, test_info):
342342 test_info ['scm_revision' ] = hexsha
343343 test_info ['scm_dirty' ] = bool (repo .untracked_files or repo .index .diff (None ) or repo .index .diff (repo .head .commit ))
344344 if self .client .api .info ().endpoints .report_test_start .version >= 3 :
345- test_info ['scm_local_branch' ] = repo .active_branch .name
346- tracking_branch = repo .active_branch .tracking_branch ()
347- if tracking_branch is not None :
348- test_info ['scm_remote_branch' ] = tracking_branch .name
345+ if not repo .head .is_detached :
346+ test_info ['scm_local_branch' ] = repo .active_branch .name
347+ tracking_branch = repo .active_branch .tracking_branch ()
348+ if tracking_branch is not None :
349+ test_info ['scm_remote_branch' ] = tracking_branch .name
349350 except Exception : # pylint: disable=broad-except
350351 _logger .warning ('Error when obtaining SCM information' , exc_info = True )
351352
Original file line number Diff line number Diff line change 11Changelog
22=========
33
4+ * :release: `2.31.2 <14-9-2017> `
5+ * :bug: `54 ` Handle cases of detached head correctly when deducing local branch
46* :release: `2.31.1 <11-9-2017> `
57* :bug: `53 ` Use api session when constructing lazy queries
68* :release: `2.31.0 <10-9-2017> `
You can’t perform that action at this time.
0 commit comments