Skip to content

Commit 5e025ce

Browse files
authored
Merge pull request #14456 from NixOS/remove-infoAttrs
getAccessorFromCommit(): Remove superfluous infoAttrs variable
2 parents 2d83bc6 + 2f6c865 commit 5e025ce

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/libfetchers/git.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -735,13 +735,10 @@ struct GitInputScheme : InputScheme
735735

736736
auto rev = *input.getRev();
737737

738-
Attrs infoAttrs({
739-
{"rev", rev.gitRev()},
740-
{"lastModified", getLastModified(*input.settings, repoInfo, repoDir, rev)},
741-
});
738+
input.attrs.insert_or_assign("lastModified", getLastModified(*input.settings, repoInfo, repoDir, rev));
742739

743740
if (!getShallowAttr(input))
744-
infoAttrs.insert_or_assign("revCount", getRevCount(*input.settings, repoInfo, repoDir, rev));
741+
input.attrs.insert_or_assign("revCount", getRevCount(*input.settings, repoInfo, repoDir, rev));
745742

746743
printTalkative("using revision %s of repo '%s'", rev.gitRev(), repoInfo.locationToArg());
747744

@@ -797,9 +794,6 @@ struct GitInputScheme : InputScheme
797794
}
798795

799796
assert(!origRev || origRev == rev);
800-
if (!getShallowAttr(input))
801-
input.attrs.insert_or_assign("revCount", getIntAttr(infoAttrs, "revCount"));
802-
input.attrs.insert_or_assign("lastModified", getIntAttr(infoAttrs, "lastModified"));
803797

804798
return {accessor, std::move(input)};
805799
}

0 commit comments

Comments
 (0)