mirror of
https://github.com/clearlinux/common.git
synced 2026-08-30 22:01:02 +00:00
koji: exit early if spec has uncommitted changes
When running 'make koji', the tooling will attempt to create a new git tag with a name constructed from the spec file's NVR. However, if there are uncommitted changes to the Name, Version, or Release fields (collectively, NVR) in that file, the new tag's name will not match the NVR in the spec file referenced by commit HEAD. Protect against the mismatch by exiting early from a 'make koji' if any spec file modifications are not yet committed to the repo, and alert the user what the problem is. Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
@@ -293,6 +293,10 @@ koji: prekoji-checks kojidef
|
||||
echo "Error: Must be on the master branch to submit to koji" >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if ! git diff --quiet HEAD ${SPECFILE}; then \
|
||||
echo "Error: All changes to ${SPECFILE} must be committed first" >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if git rev-parse --verify --quiet origin/master > /dev/null; then \
|
||||
git pull --rebase; \
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user