From 812280b23abcec41adf6020f304d8711923e3202 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 2 May 2022 13:37:53 +0200 Subject: [PATCH] Style fixes (cherry picked from commit 61289ceee3417cd2aa8e8db9fe117a5813969aed) --- src/libfetchers/git.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index 2ff27795d..42be1d66d 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -23,11 +23,7 @@ const std::string gitInitialBranch = "__nix_dummy_branch"; static std::string getGitDir() { - auto gitDir = getEnv("GIT_DIR"); - if (!gitDir) { - return ".git"; - } - return *gitDir; + return getEnv("GIT_DIR").value_or(".git"); } static std::string readHead(const Path & path)