setup: fix some formatting
In preparation for touching code that was introduced in 3b0bf2704980 (setup: tighten ownership checks post CVE-2022-24765, 2022-05-10) and that was formatted differently than preferred in the Git project, fix the indentation before actually modifying the code. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Aug 8, 2022 at 13:27 UTC
d51e1dff980b9fc87002436b6ab36120a39816b1
1 file changed
+5
-4
setup.c
+5
-4
@@ -1138,7 +1138,7 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
1138
* added, for bare ones their git directory.
1139
*/
1140
static int ensure_valid_ownership(const char *gitfile,
1141
- const char *worktree, const char *gitdir)
1141
+ const char *worktree, const char *gitdir)
1142
{
1143
struct safe_directory_data data = {
1144
.path = worktree ? worktree : gitdir
@@ -1271,10 +1271,11 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
1271
strbuf_setlen(dir, offset);
1272
if (gitdirenv) {
1273
enum discovery_result ret;
1274
+ const char *gitdir_candidate =
1275
+ gitdir_path ? gitdir_path : gitdirenv;
1276
1275
- if (ensure_valid_ownership(gitfile,
1276
- dir->buf,
1277
- (gitdir_path ? gitdir_path : gitdirenv))) {
1277
+ if (ensure_valid_ownership(gitfile, dir->buf,
1278
+ gitdir_candidate)) {
1279
strbuf_addstr(gitdir, gitdirenv);
1280
ret = GIT_DIR_DISCOVERED;
1281
} else