From: Vincenzo di Cicco Date: Mon, 10 Mar 2014 23:55:00 GMT Subject: Re: [PATCH][GSoC] branch.c:install_branch_config Simplified long chain of if statements Message-ID: In-Reply-To: Thank you very much for the answer! I've learned a lot in this few rows. > If we take the time to trace through the code, we can see that > remote_is_branch is indeed either 0 or 1, thus this expression is safe > today, however, if the implementation of starts_with() ever changes so > that it returns a value other than 1 for true, then this code will > break. To avoid such breakage, and to avoid placing burden of tracing > code, you might instead write the expression as: > > location = locations[!!origin][!!remote_is_branch]; Thanks for the good tip. I've erroneously assumed that starts_with() never will change. > This approach of composing strings is problematic for translation, > which is why the GSoC microproject states: Thanks to show me this issue. I've read the other thread and understood the problem. I will do better in future :)