git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 1/3] git-sh-setup: move GIT_DIR initialization into a function

From
David Aguilar <davvid@gmail.com>
Date
Oct 11, 2014, 08:39 UTC
Message-ID
<1413016778-94829-1-git-send-email-davvid@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
---
This is a new patch since the last round, prep for 2/3
 git-sh-setup.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 9447980..d968760 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -330,8 +330,7 @@ esac
 
 # Make sure we are in a valid repository of a vintage we understand,
 # if we require to be in a git repository.
-if test -z "$NONGIT_OK"
-then
+git_dir_init () {
 	GIT_DIR=$(git rev-parse --git-dir) || exit
 	if [ -z "$SUBDIRECTORY_OK" ]
 	then
@@ -346,6 +345,11 @@ then
 		exit 1
 	}
 	: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+}
+
+if test -z "$NONGIT_OK"
+then
+	git_dir_init
 fi
 
 peel_committish () {
-- 
2.1.2.378.g89c0b73
Next: David Aguilar
Message 1 of 6 in “git-sh-setup: move GIT_DIR initialization into a function”
  1. 1/3 git-sh-setup: move GIT_DIR initialization into a functionDavid Aguilar, Oct 11, 2014
  2. 2/3 mergetool: don't require a work tree for --tool-helpDavid Aguilar, Oct 11, 2014
  3. 3/3 difftool: don't assume that default sh is saneDavid Aguilar, Oct 11, 2014
  4. Junio C HamanoOct 13, 2014
  5. David AguilarOct 15, 2014
  6. David AguilarOct 15, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.