mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
patman: Clean up creation of the git tree
The test starts with the HEAD pointing to the wrong place, so that the created files appear to be deleted. Fix this by resetting the tree before tests start. Add a check that the tree is clean. Update pygit2 so that the enums are available.
This commit is contained in:
@@ -757,6 +757,24 @@ def get_branch(git_dir=None):
|
||||
return out
|
||||
|
||||
|
||||
def check_dirty(git_dir=None, work_tree=None):
|
||||
"""Check if the tree is dirty
|
||||
|
||||
Args:
|
||||
git_dir (str): Path to git repository (None to use default)
|
||||
|
||||
Return:
|
||||
str: List of dirty filenames and state
|
||||
"""
|
||||
cmd = ['git']
|
||||
if git_dir:
|
||||
cmd += ['--git-dir', git_dir]
|
||||
if work_tree:
|
||||
cmd += ['--work-tree', work_tree]
|
||||
cmd += ['status', '--porcelain', '--untracked-files=no']
|
||||
return command.output(*cmd).splitlines()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import doctest
|
||||
|
||||
|
||||
Reference in New Issue
Block a user