From: Jordan Petridis Date: Fri, 17 Apr 2020 05:08:15 +0000 (+0300) Subject: clone_manifest_ref: add the ability to fetch instead of cloning the repo X-Git-Tag: 1.19.3~497^2~169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26c45d6ca32934e6610e3be70f898b6e0e54c768;p=platform%2Fupstream%2Fgstreamer.git clone_manifest_ref: add the ability to fetch instead of cloning the repo --- diff --git a/gitlab/clone_manifest_ref.py b/gitlab/clone_manifest_ref.py index cbaf75d..b26043b 100755 --- a/gitlab/clone_manifest_ref.py +++ b/gitlab/clone_manifest_ref.py @@ -67,6 +67,7 @@ if __name__ == "__main__": parser.add_argument("--project", action="store", type=str) parser.add_argument("--destination", action="store", type=str, default='.') parser.add_argument("--manifest", action="store", type=str) + parser.add_argument("--fetch", action="store_true", default=False) options = parser.parse_args() if not options.project: @@ -82,5 +83,10 @@ if __name__ == "__main__": if dest == '.': dest = os.path.join (os.getcwd(), project.name) - git('clone', project.fetch_uri, dest) + if options.fetch: + assert os.path.exists(dest) == True + git('fetch', project.fetch_uri, project.revision, repository_path=dest) + else: + git('clone', project.fetch_uri, dest) + git('checkout', '--detach', project.revision, repository_path=dest)