diff --git a/codearchiver/modules/git.py b/codearchiver/modules/git.py index f50938c..1e6aa1e 100644 --- a/codearchiver/modules/git.py +++ b/codearchiver/modules/git.py @@ -119,7 +119,7 @@ class Git(codearchiver.core.Module): objectsToExclude = baseBundleObjects & commitsAndTags input = ''.join(f'^{o}\n' for o in objectsToExclude).encode('ascii') status, _, stderr = codearchiver.subprocess.run_with_log(cmd, cwd = directory, input = input, check = False) - if status == 128 and stderr == 'fatal: Refusing to create empty bundle.\n': + if status == 128 and (stderr == 'fatal: Refusing to create empty bundle.\n' or stderr.endswith('\nfatal: Refusing to create empty bundle.\n')): # Manually write an empty bundle instead # Cf. Documentation/technical/bundle-format.txt and Documentation/technical/pack-format.txt in git's repository for details on the formats _logger.info('Writing empty bundle directly instead')