anchor.diff:               let fileContent = lib.fileContents fileName;
                    matchRef    = match "^ref: (.*)$" fileContent;
                in if  matchRef == null
  -                then fileContent
  +                then { value = fileContent; }
                   else readCommitFromFile (lib.head matchRef) path
   
              else if pathIsRegularFile packedRefsName
  
positive.code:       in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts;
      in cleanSourceWith { inherit filter src; };
  
    pathIsGitRepo = path: (tryEval (commitIdFromGitRepo path)).success;
  
    /*
      Get the commit id of a git repo.
  
      Example: commitIdFromGitRepo <nixpkgs/.git>
    */
    commitIdFromGitRepo =
      let readCommitFromFile = file: path:
          let fileName       = path + "/${file}";
              packedRefsName = path + "/packed-refs";
  
negative.code:            then
               let m   = match "^gitdir: (.*)$" (lib.fileContents path);
               in if m == null
                  then { error = "File contains no gitdir reference: " + path; }
                  else
                    let gitDir      = absolutePath (dirOf path) (lib.head m);
                        commonDir'' = if pathIsRegularFile "${gitDir}/commondir"
  