Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] Do not initialize sha1_file_directory by hand.
Date: Fri, 06 May 2005 16:32:28 -0700	[thread overview]
Message-ID: <7vsm10aq2b.fsf@assigned-by-dhcp.cox.net> (raw)

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: Junio C Hamano <junkio@cox.net>
---

 ls-tree.c    |    3 ---
 read-cache.c |    5 -----
 tar-tree.c   |    5 -----
 3 files changed, 13 deletions(-)

--- a/ls-tree.c
+++ b/ls-tree.c
@@ -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;
--- a/read-cache.c
+++ b/read-cache.c
@@ -193,11 +193,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");
--- a/tar-tree.c
+++ b/tar-tree.c
@@ -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);
----------------------------------------------------------------


                 reply	other threads:[~2005-05-06 23:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vsm10aq2b.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox