diff options
author | Urs Fässler <urs.fassler@bbv.ch> | 2018-10-08 08:15:11 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-17 12:24:05 +0100 |
commit | 78d8fb3a7899e1404a513be1c2b2b4440da8b12d (patch) | |
tree | cf0a7a73a7aa1a6af5cf5890d6b8d604c7b27c63 | |
parent | 30cf2506007d25162f0805051212f54c39034ff3 (diff) | |
download | bitbake-78d8fb3a7899e1404a513be1c2b2b4440da8b12d.tar.gz |
fetch2/git: explicitly show the decision logic to select the source in code
Signed-off-by: Urs Fässler <urs.fassler@bbv.ch>
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/fetch2/git.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index 3e37f76ff..51259df93 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -476,11 +476,12 @@ class Git(FetchMethod): if os.path.exists(destdir): bb.utils.prunedir(destdir) - if ud.shallow and os.path.exists(ud.fullshallow) and self.clonedir_need_update(ud, d): + clonedir_is_up_to_date = not self.clonedir_need_update(ud, d) + if clonedir_is_up_to_date: + runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d) + elif ud.shallow and os.path.exists(ud.fullshallow): bb.utils.mkdirhier(destdir) runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) - elif not self.clonedir_need_update(ud, d): - runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d) else: raise bb.fetch2.UnpackError("No up to date source found", ud.url) |