Skip to content

Commit 272459a

Browse files
newrengitster
authored andcommitted
Ensure proper setup of git_dir for git-hash-object
Call setup_git_directory() before git_config() to make sure git_dir is set to the proper value. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8104ebf commit 272459a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hash-object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ int main(int argc, const char **argv)
8181

8282
type = blob_type;
8383

84-
git_config(git_default_config, NULL);
85-
8684
argc = parse_options(argc, argv, hash_object_options, hash_object_usage, 0);
8785

8886
if (write_object) {
@@ -92,6 +90,8 @@ int main(int argc, const char **argv)
9290
vpath = prefix_filename(prefix, prefix_length, vpath);
9391
}
9492

93+
git_config(git_default_config, NULL);
94+
9595
if (stdin_paths) {
9696
if (hashstdin)
9797
errstr = "Can't use --stdin-paths with --stdin";

0 commit comments

Comments
 (0)