Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-12 23:51:30 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-12 23:51:30 +0300
commitd46f95a2bd265b195e6a9e88896d200b6b3a203f (patch)
tree5b57e9cbec7881eb49fe18f057264b5e3906cff8
parentdca0768820fe373a66049ef3a223c32a1a3c8a59 (diff)
parent6540b716140784f329de7bac954d2651e9d3e321 (diff)
Merge branch 'cb/remote-ndebug-fix' into maint
Build fix. * cb/remote-ndebug-fix: remote: avoid -Wunused-but-set-variable in gcc with -DNDEBUG
-rw-r--r--remote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/remote.c b/remote.c
index dfb863d808..40e785da38 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;
}