1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 21:56:07 +02:00

Merge branch 'cb/remote-ndebug-fix'

Build fix.

* cb/remote-ndebug-fix:
  remote: avoid -Wunused-but-set-variable in gcc with -DNDEBUG
This commit is contained in:
Junio C Hamano 2021-09-10 11:46:30 -07:00
commit a4b1a0ade4

View File

@ -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;
}