about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/primops
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T17·01+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T17·01+0100
commit09cbc431cca08be891e5e792ceda2a34956b2fc8 (patch)
tree3653448c7e074bdfd10dfa3bc3b5dfe952299fdf /third_party/nix/src/libexpr/primops
parentb490742a511dd03afc43f5143d6d61edaeeb8091 (diff)
fix(3p/nix): Fix incorrectly braced conditionals and loops r/768
Fixes mistakes introduced by clang-tidy in the previous commit.
Diffstat (limited to 'third_party/nix/src/libexpr/primops')
-rw-r--r--third_party/nix/src/libexpr/primops/fetchGit.cc3
-rw-r--r--third_party/nix/src/libexpr/primops/fetchMercurial.cc3
2 files changed, 2 insertions, 4 deletions
diff --git a/third_party/nix/src/libexpr/primops/fetchGit.cc b/third_party/nix/src/libexpr/primops/fetchGit.cc
index af3f89fde77a..7fbd4dc92cf0 100644
--- a/third_party/nix/src/libexpr/primops/fetchGit.cc
+++ b/third_party/nix/src/libexpr/primops/fetchGit.cc
@@ -228,9 +228,8 @@ static void prim_fetchGit(EvalState& state, const Pos& pos, Value** args,
       throw EvalError(format("'url' argument required, at %1%") % pos);
 
   } else {
-    url
+    url = state.coerceToString(pos, *args[0], context, false, false);
   }
-  = state.coerceToString(pos, *args[0], context, false, false);
 
   // FIXME: git externals probably can be used to bypass the URI
   // whitelist. Ah well.
diff --git a/third_party/nix/src/libexpr/primops/fetchMercurial.cc b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
index 5847f6021f43..3de42fe770dc 100644
--- a/third_party/nix/src/libexpr/primops/fetchMercurial.cc
+++ b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
@@ -204,9 +204,8 @@ static void prim_fetchMercurial(EvalState& state, const Pos& pos, Value** args,
       throw EvalError(format("'url' argument required, at %1%") % pos);
 
   } else {
-    url
+    url = state.coerceToString(pos, *args[0], context, false, false);
   }
-  = state.coerceToString(pos, *args[0], context, false, false);
 
   // FIXME: git externals probably can be used to bypass the URI
   // whitelist. Ah well.