Use the expanded commit name internally
[invirt/packages/invirt-dev.git] / invirtibuilder
index aa70b53..24861f5 100755 (executable)
@@ -288,11 +288,11 @@ def build():
 
         try:
             db.failed_stage = 'validating job'
 
         try:
             db.failed_stage = 'validating job'
-            src = b.validateBuild(pocket, package, commit)
             # Don't expand the commit in the DB until we're sure the user
             # isn't trying to be tricky.
             # Don't expand the commit in the DB until we're sure the user
             # isn't trying to be tricky.
-            db.commit = commit = c.captureOutput(['git', 'rev-parse', commit],
-                                                 cwd=b.getRepo(package)).strip()
+            b.ensureValidPackage(package)
+            db.commit = commit = b.canonicalize_commit(package, commit)
+            src = b.validateBuild(pocket, package, commit)
 
             db.version = str(b.getVersion(package, commit))
 
 
             db.version = str(b.getVersion(package, commit))