Skip to content

Commit d51e1df

Browse files
dschogitster
authored andcommitted
setup: fix some formatting
In preparation for touching code that was introduced in 3b0bf27 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bbea4dc commit d51e1df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

setup.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
11381138
* added, for bare ones their git directory.
11391139
*/
11401140
static int ensure_valid_ownership(const char *gitfile,
1141-
const char *worktree, const char *gitdir)
1141+
const char *worktree, const char *gitdir)
11421142
{
11431143
struct safe_directory_data data = {
11441144
.path = worktree ? worktree : gitdir
@@ -1271,10 +1271,11 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
12711271
strbuf_setlen(dir, offset);
12721272
if (gitdirenv) {
12731273
enum discovery_result ret;
1274+
const char *gitdir_candidate =
1275+
gitdir_path ? gitdir_path : gitdirenv;
12741276

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)) {
12781279
strbuf_addstr(gitdir, gitdirenv);
12791280
ret = GIT_DIR_DISCOVERED;
12801281
} else

0 commit comments

Comments
 (0)