diff options
| author | Simon Glass <[email protected]> | 2023-10-30 10:22:30 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-11-02 22:38:01 -0400 |
| commit | a44cb1f2402a7f20f68e245bd37d6bdfe34e70f2 (patch) | |
| tree | 94a9ed7f6c3803476280bc5e6bd16cdef11d24c5 /tools/patman/gitutil.py | |
| parent | be6a249b417fb159db6fc3f4b7d72eb2fd036554 (diff) | |
buildman: Support upstream branch name containing /
Buildman assumes that branch names do not have a slash in them, since
slash is used to delimit remotes, etc. This means that a branch called
'WIP/tryme' in remote dm ends up being 'tryme'.
Adjust the logic a little, to try to accommodate this.
For now, no tests are added for this behaviour.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Diffstat (limited to 'tools/patman/gitutil.py')
| -rw-r--r-- | tools/patman/gitutil.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index b0a12f2e8c0..10ea5ff39f5 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -147,8 +147,9 @@ def get_upstream(git_dir, branch): if remote == '.': return merge, None elif remote and merge: - leaf = merge.split('/')[-1] - return '%s/%s' % (remote, leaf), None + # Drop the initial refs/heads from merge + leaf = merge.split('/', maxsplit=2)[2:] + return '%s/%s' % (remote, '/'.join(leaf)), None else: raise ValueError("Cannot determine upstream branch for branch " "'%s' remote='%s', merge='%s'" |
