oeqa/utils/gitarchive: Return tag name and improve exclude handling

Tweak the gitarchive exclude handling not to error if excluded files
don't match.

Also return the tagname created so that other code can then use it.

(From OE-Core rev: 0a5b4fabf8bf9b559295bb4d2583809ca11522f4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1adba3430faffdf6217b6a00533a3b48a9388abc)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Richard Purdie
2024-11-22 16:06:23 +00:00
committed by Steve Sakoman
parent a7ccf5b7bd
commit 29e16888a5

View File

@@ -67,7 +67,7 @@ def git_commit_data(repo, data_dir, branch, message, exclude, notes, log):
# Remove files that are excluded
if exclude:
repo.run_cmd(['rm', '--cached'] + [f for f in exclude], env_update)
repo.run_cmd(['rm', '--cached', '--ignore-unmatch'] + [f for f in exclude], env_update)
tree = repo.run_cmd('write-tree', env_update)
@@ -202,6 +202,8 @@ def gitarchive(data_dir, git_dir, no_create, bare, commit_msg_subject, commit_ms
log.info("Pushing data to remote")
data_repo.run_cmd(cmd)
return tag_name
# Container class for tester revisions
TestedRev = namedtuple('TestedRev', 'commit commit_number tags')