Skip to content

Commit

Permalink
Ensure proper setup of git_dir for git-hash-object
Browse files Browse the repository at this point in the history
Call setup_git_directory() before git_config() to make sure git_dir is set
to the proper value.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Elijah Newren authored and Junio C Hamano committed Feb 28, 2009
1 parent 8104ebf commit 272459a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hash-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ int main(int argc, const char **argv)

type = blob_type;

git_config(git_default_config, NULL);

argc = parse_options(argc, argv, hash_object_options, hash_object_usage, 0);

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

git_config(git_default_config, NULL);

if (stdin_paths) {
if (hashstdin)
errstr = "Can't use --stdin-paths with --stdin";
Expand Down

0 comments on commit 272459a

Please sign in to comment.