diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2017-09-07 15:05:38 +0100 |
---|---|---|
committer | Ben Brown <ben.brown@codethink.co.uk> | 2017-09-07 16:26:07 +0100 |
commit | 9b70735a94e64c3436b87b8d55aabe90aa94e69f (patch) | |
tree | cfe4e6fe45e31e19dc6e0caf2828da0c57807ce4 | |
parent | d68a3068b5d558e148b62acd6bd914a54e6ed091 (diff) | |
download | ybd-9b70735a94e64c3436b87b8d55aabe90aa94e69f.tar.gz |
Split tracking-branch logic into its own method
-rw-r--r-- | ybd/repos.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ybd/repos.py b/ybd/repos.py index 9674ee9..65cdd12 100644 --- a/ybd/repos.py +++ b/ybd/repos.py @@ -98,10 +98,14 @@ def get_last_tag(gitdir): return None +def tracking_branch(dn): + track = app.config.get('track-branches', []) + return (isinstance(track, list) and dn['path'] in track) or track + + def get_tree(dn): info = get_transport_info(dn['repo']) - track = app.config.get('track-branches', []) - track = (isinstance(track, list) and dn['path'] in track) or track + track = tracking_branch(dn) ref = dn.get('ref') if track else dn.get('sha', dn.get('ref')) gitdir = info['dir'] |