mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 12:49:01 +02:00
Use top commit for subdirectory instead of repository in update script
If there is more than one layer in a repository, we want the latest commit in the subdirectory not the entire repository (since we use it to determine the last commit date which should show how "fresh" the layer is). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
e0f8a05423
commit
d56d280be7
|
@ -286,6 +286,12 @@ def main():
|
|||
repo = git.Repo(repodir)
|
||||
assert repo.bare == False
|
||||
topcommit = repo.commit('master')
|
||||
if layer.vcs_subdir:
|
||||
# Find latest commit in subdirectory
|
||||
# A bit odd to do it this way but apparently there's no other way in the GitPython API
|
||||
for commit in repo.iter_commits(paths=layer.vcs_subdir):
|
||||
topcommit = commit
|
||||
break
|
||||
|
||||
layerdir = os.path.join(repodir, layer.vcs_subdir)
|
||||
layerdir_start = os.path.normpath(layerdir) + os.sep
|
||||
|
|
Loading…
Reference in New Issue
Block a user