summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-10 18:46:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-10 18:46:30 (GMT)
commita4b1a0ade42a03e81376144653400c061fa6ed52 (patch)
tree2a302df433e89aeaa535992d880d9ed6b5eeed8b /remote.c
parentfd0d7036e0da248f354e91fb8be8771fb20adfac (diff)
parent6540b716140784f329de7bac954d2651e9d3e321 (diff)
downloadgit-a4b1a0ade42a03e81376144653400c061fa6ed52.zip
git-a4b1a0ade42a03e81376144653400c061fa6ed52.tar.gz
git-a4b1a0ade42a03e81376144653400c061fa6ed52.tar.bz2
Merge branch 'cb/remote-ndebug-fix'
Build fix. * cb/remote-ndebug-fix: remote: avoid -Wunused-but-set-variable in gcc with -DNDEBUG
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/remote.c b/remote.c
index 4ef53a6..31e141b 100644
--- a/remote.c
+++ b/remote.c
@@ -135,7 +135,7 @@ static inline void init_remotes_hash(void)
static struct remote *make_remote(const char *name, int len)
{
- struct remote *ret, *replaced;
+ struct remote *ret;
struct remotes_hash_key lookup;
struct hashmap_entry lookup_entry, *e;
@@ -162,8 +162,8 @@ static struct remote *make_remote(const char *name, int len)
remotes[remotes_nr++] = ret;
hashmap_entry_init(&ret->ent, lookup_entry.hash);
- replaced = hashmap_put_entry(&remotes_hash, ret, ent);
- assert(replaced == NULL); /* no previous entry overwritten */
+ if (hashmap_put_entry(&remotes_hash, ret, ent))
+ BUG("hashmap_put overwrote entry after hashmap_get returned NULL");
return ret;
}