1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-24 22:06:14 +01:00

Merge pull request #1033 from dmach/linkdiff-missing-added-file

linkdiff: Raise an exception when an added file is missing
This commit is contained in:
Marco Strigl 2022-05-12 10:51:15 +02:00 committed by GitHub
commit ed78dcbfd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2000,6 +2000,9 @@ class Package:
rev = 'working copy'
diff.append(b'+++ %s\t(%s)\n' % (fname.encode(), rev.encode()))
fname = os.path.join(self.absdir, fname)
if not os.path.isfile(fname):
raise oscerr.OscIOError(None, 'file \'%s\' is marked as \'A\' but does not exist\n'
'(either add the missing file or revert it)' % fname)
else:
if revision:
b_revision = str(revision).encode()