force fetchGit allRefs when a dependency is specified with "rev"

The usage of git "rev" dependencies in Cargo implies that the rev
will be found regardless of ref.  This is currently not true in naersk;
the following dependency fails:

usbfs = {git = "https://github.com/goertzenator/usbfs-rs", rev = "7c35b46e41ad76f838cd99b493f9337f475b5b70"}
This commit is contained in:
Daniel Goertzen 2022-06-03 16:36:19 -05:00 committed by Patryk Wychowaniec
parent 14997a79cd
commit e300ddf8cb

View file

@ -111,7 +111,7 @@ rec
ref = lock.branch;
} // lib.optionalAttrs (lock ? tag) {
ref = lock.tag;
} // lib.optionalAttrs gitAllRefs {
} // lib.optionalAttrs (gitAllRefs || lock ? rev) {
allRefs = true;
} // lib.optionalAttrs gitSubmodules {
submodules = true;