aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bb/fetch2/git.py7
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)