Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 67373ae38984
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3c2e9fa53d23
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 14, 2020

  1. lib.commitIdFromGitRepo: fix support for git-submodule

    Adds handling for relative references from .git-files, fixing a bug introduced by c9214c3.
    elseym committed Jan 14, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    dtzWill Will Dietz
    Copy the full SHA
    9d396d2 View commit details

Commits on Jan 15, 2020

  1. Merge pull request #77704 from mayflower/also-submodules

    lib.commitIdFromGitRepo: fix support for git-submodule
    infinisil authored Jan 15, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3c2e9fa View commit details
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/sources.nix
10 changes: 6 additions & 4 deletions lib/sources.nix
Original file line number Diff line number Diff line change
@@ -113,20 +113,22 @@ rec {
with builtins;
let fileName = toString path + "/" + file;
packedRefsName = toString path + "/packed-refs";
absolutePath = base: path:
if lib.hasPrefix "/" path
then path
else toString (/. + "${base}/${path}");
in if pathIsRegularFile path
# Resolve git worktrees. See gitrepository-layout(5)
then
let m = match "^gitdir: (.*)$" (lib.fileContents path);
in if m == null
then throw ("File contains no gitdir reference: " + path)
else
let gitDir = lib.head m;
let gitDir = absolutePath (dirOf path) (lib.head m);
commonDir' = if pathIsRegularFile "${gitDir}/commondir"
then lib.fileContents "${gitDir}/commondir"
else gitDir;
commonDir = if lib.hasPrefix "/" commonDir'
then commonDir'
else toString (/. + "${gitDir}/${commonDir'}");
commonDir = absolutePath gitDir commonDir';
refFile = lib.removePrefix "${commonDir}/" "${gitDir}/${file}";
in readCommitFromFile refFile commonDir