[riot-notifications] [RIOT-OS/RIOT] pkg/pkg.mk: Avoid doing a git fetch if we already have the commit. (#11491)

Gaƫtan Harter notifications at github.com
Mon May 6 13:53:35 CEST 2019


cladmi commented on this pull request.



> @@ -32,7 +32,9 @@ endif
 git-ensure-version: $(PKG_BUILDDIR)/.git-downloaded
 	if [ $(shell git -C $(PKG_BUILDDIR) rev-parse HEAD) != $(PKG_VERSION) ] ; then \
 		git -C $(PKG_BUILDDIR) clean -xdff ; \
-		git -C $(PKG_BUILDDIR) fetch "$(PKG_URL)" "$(PKG_VERSION)" ; \
+		if git cat-file -e -t '$(PKG_VERSION)^{commit}' ; then \

```
git cat-file -e 2019.04^{commit} && echo commit
commit
```
```
git cat-file -e 2019.04-branch^{commit}
fatal: Not a valid object name 2019.04-branch^{commit}
```

Also works with a hash as expected.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11491#discussion_r281153691
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190506/bf995b8b/attachment.html>


More information about the notifications mailing list