Commit 3d0291c4 authored by Junio C Hamano's avatar Junio C Hamano Committed by Linus Torvalds

[PATCH] Do not initialize sha1_file_directory by hand.

Some commands initialize sha1_file_directory by hand.  There is no
need to do so; sha1_file.c knows how to handle it.

The next patch will remove the variable altogether.
Signed-off-by: default avatarJunio C Hamano <[email protected]>
Signed-off-by: default avatarLinus Torvalds <[email protected]>
parent ee267527
......@@ -104,9 +104,6 @@ int main(int argc, char **argv)
usage(ls_tree_usage);
if (get_sha1(argv[1], sha1) < 0)
usage(ls_tree_usage);
sha1_file_directory = getenv(DB_ENVIRONMENT);
if (!sha1_file_directory)
sha1_file_directory = DEFAULT_DB_ENVIRONMENT;
if (list(sha1) < 0)
die("list failed");
return 0;
......
......@@ -196,11 +196,6 @@ int read_cache(void)
if (active_cache)
return error("more than one cachefile");
errno = ENOENT;
sha1_file_directory = getenv(DB_ENVIRONMENT);
if (!sha1_file_directory)
sha1_file_directory = DEFAULT_DB_ENVIRONMENT;
if (access(sha1_file_directory, X_OK) < 0)
return error("no access to SHA1 file directory");
fd = open(get_index_file(), O_RDONLY);
if (fd < 0)
return (errno == ENOENT) ? 0 : error("open failed");
......
......@@ -418,10 +418,6 @@ int main(int argc, char **argv)
usage(tar_tree_usage);
}
sha1_file_directory = getenv(DB_ENVIRONMENT);
if (!sha1_file_directory)
sha1_file_directory = DEFAULT_DB_ENVIRONMENT;
buffer = read_object_with_reference(sha1, "commit", &size, commit_sha1);
if (buffer) {
write_global_extended_header(commit_sha1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment