Commit 98f31ca
committed
fetchGit: don't resolve HEAD ref when a specific rev is requested
When fetchGit is called with a rev but no explicit ref, the code
unconditionally called getDefaultRef() which contacts the remote to
resolve HEAD. This caused an unnecessary network round-trip (~800ms)
even when the requested rev was already in the local cache.
Skip resolving the default ref when a rev is specified, since the rev
can be fetched directly by its hash.
Fixes NixOS#10773.1 parent a7a6c4f commit 98f31ca
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
862 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
863 | 868 | | |
864 | 869 | | |
865 | 870 | | |
| |||
941 | 946 | | |
942 | 947 | | |
943 | 948 | | |
944 | | - | |
| 949 | + | |
945 | 950 | | |
946 | 951 | | |
947 | 952 | | |
| |||
0 commit comments