diff mbox series

oeqa/selftest/context: set branch name when creating temporary git repo

Message ID 20220722111534.2144462-1-ross.burton@arm.com
State New
Headers show
Series oeqa/selftest/context: set branch name when creating temporary git repo | expand

Commit Message

Ross Burton July 22, 2022, 11:15 a.m. UTC
Modern gits print a big note if no branch name is specified when
creating a new repository.  Silence this by explicitly naming the new
branch 'master' to match existing naming.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oeqa/selftest/context.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie July 24, 2022, 4:20 p.m. UTC | #1
On Fri, 2022-07-22 at 12:15 +0100, Ross Burton wrote:
> Modern gits print a big note if no branch name is specified when
> creating a new repository.  Silence this by explicitly naming the new
> branch 'master' to match existing naming.
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/lib/oeqa/selftest/context.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
> index 78c7a467e2f..76a188397aa 100644
> --- a/meta/lib/oeqa/selftest/context.py
> +++ b/meta/lib/oeqa/selftest/context.py
> @@ -92,7 +92,7 @@ class OESelftestTestContext(OETestContext):
>              if os.environ[e].endswith(builddir):
>                  os.environ[e] = os.environ[e].replace(builddir, newbuilddir)
>  
> -        subprocess.check_output("git init; git add *; git commit -a -m 'initial'", cwd=newselftestdir, shell=True)
> +        subprocess.check_output("git init -b master; git add *; git commit -a -m 'initial'", cwd=newselftestdir, shell=True)
>  
>          # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow
>          subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True)

Doesn't work I'm afraid:

https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/1220

Cheers,

Richard
Ross Burton July 25, 2022, 1:59 p.m. UTC | #2
On 24 Jul 2022, at 17:20, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> Doesn't work I'm afraid:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/1220

I checked older git releases but didn’t think that ubuntu 1804 was so old.  Oh well, we’ll just have to shelve this until all supported distros have a modern git.

Ross
Richard Purdie July 25, 2022, 2:14 p.m. UTC | #3
On Mon, 2022-07-25 at 13:59 +0000, Ross Burton wrote:
> On 24 Jul 2022, at 17:20, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> > Doesn't work I'm afraid:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/1220
> 
> I checked older git releases but didn’t think that ubuntu 1804 was so
> old.  Oh well, we’ll just have to shelve this until all supported
> distros have a modern git.

Is it worth a version check to quieten the logs?

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index 78c7a467e2f..76a188397aa 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -92,7 +92,7 @@  class OESelftestTestContext(OETestContext):
             if os.environ[e].endswith(builddir):
                 os.environ[e] = os.environ[e].replace(builddir, newbuilddir)
 
-        subprocess.check_output("git init; git add *; git commit -a -m 'initial'", cwd=newselftestdir, shell=True)
+        subprocess.check_output("git init -b master; git add *; git commit -a -m 'initial'", cwd=newselftestdir, shell=True)
 
         # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow
         subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True)