Skip to content

Commit c396146

Browse files
troyreadyphobologic
authored andcommitted
update git ref to explicitly return string (fix py3 bytes error) (#649)
1 parent 6f2cc37 commit c396146

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

stacker/tests/test_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def test_SourceProcessor_helpers(self):
252252
GitPackageSource({'uri': 'https://github.com/remind101/'
253253
'stacker.git',
254254
'branch': 'release-1.0'})),
255-
b'857b4834980e582874d70feef77bb064b60762d1'
255+
'857b4834980e582874d70feef77bb064b60762d1'
256256
)
257257
self.assertEqual(
258258
sp.determine_git_ref(

stacker/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,8 @@ def determine_git_ref(self, config):
877877
config['uri'],
878878
self.determine_git_ls_remote_ref(config)
879879
)
880+
if sys.version_info[0] > 2 and isinstance(ref, bytes):
881+
return ref.decode()
880882
return ref
881883

882884
def sanitize_uri_path(self, uri):

0 commit comments

Comments
 (0)