summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2017-09-01 10:18:54 +0100
committerBen Brown <ben.brown@codethink.co.uk>2017-09-04 17:06:12 +0100
commit0a7ebf5bb24805e851076e73924e18bf40c2d09b (patch)
tree1ec008aafc47a78c14bbf51ecefc27cac2891b25
parentc7603880254ed542ff4b1aae3d589d731e161870 (diff)
downloadybd-0a7ebf5bb24805e851076e73924e18bf40c2d09b.tar.gz
Use sha in place of ref
This will be set by get_tree() at this point.
-rw-r--r--ybd/release_note.py2
-rw-r--r--ybd/repos.py4
-rw-r--r--ybd/splitting.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/ybd/release_note.py b/ybd/release_note.py
index 7d44b59..c3c1c93 100644
--- a/ybd/release_note.py
+++ b/ybd/release_note.py
@@ -100,7 +100,7 @@ def log_changes(dn, tmpdir, old_defs, ref):
try:
gitdir = os.path.join(config['gits'],
get_repo_name(dn['repo']))
- cur_ref = dn.get('sha', dn['ref'])
+ cur_ref = dn['sha']
old_ref = old_def.get('sha', old_def['ref'])
if old_ref != cur_ref:
log(dn, 'Logging git change history', tmpdir)
diff --git a/ybd/repos.py b/ybd/repos.py
index 3567a53..099a9f3 100644
--- a/ybd/repos.py
+++ b/ybd/repos.py
@@ -195,7 +195,7 @@ def update_mirror(name, repo, gitdir):
def checkout(dn):
- _checkout(dn['name'], dn['repo'], dn.get('sha', dn['ref']), dn['checkout'])
+ _checkout(dn['name'], dn['repo'], dn['sha'], dn['checkout'])
with app.chdir(dn['checkout']):
if os.path.exists('.gitmodules') or dn.get('submodules'):
@@ -314,7 +314,7 @@ def checkout_submodules(dn):
try:
# list objects in the parent repo tree to find the commit
# object that corresponds to the submodule
- commit = check_output(['git', 'ls-tree', dn['ref'], path])
+ commit = check_output(['git', 'ls-tree', dn['sha'], path])
# read the commit hash from the output
fields = commit.split()
diff --git a/ybd/splitting.py b/ybd/splitting.py
index 3797a1f..770cb64 100644
--- a/ybd/splitting.py
+++ b/ybd/splitting.py
@@ -255,7 +255,7 @@ def write_metafile(rules, splits, dn):
if dn.get('kind', 'chunk') == 'chunk':
metadata['repo'] = dn.get('repo')
- metadata['ref'] = dn.get('ref')
+ metadata['ref'] = dn.get('sha')
else:
if config.get('artifact-version', 0) not in range(0, 2):
metadata['repo'] = config['defdir']