Thread (17 messages) flat view 17 messages, 3 authors, 2016-06-15

Re: [PATCH 2/5] Fix setup of $GIT_DIR in git-sh-setup.sh

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:14

Lars Hjemli [off-list ref] writes:
Since .git can be a file refering to the real GIT_DIR, git-sh-setup needs
to use 'git rev-parse --git-dir' to obtain the location of the git
repository.
I wonder if this depend on your [1/5].  Isn't this actually a
simplification (removing 7 adding 5 lines) that applies to the
mainline already?  IOW, is there a downside of doing this
without any of the rest of the series?
quoted hunk ↗ jump to hunk
@@ -127,20 +127,18 @@ get_author_ident_from_commit () {
 # if we require to be in a git repository.
 if test -z "$NONGIT_OK"
 then
+	GIT_DIR=$(git rev-parse --git-dir) || {
+		exit=$?
+		echo >&2 "Failed to find a valid git directory."
+		exit $exit
rev-parse --git-dir would have said "fatal: Not a git
repository" already.  Do we still need to say "Failed to
find..."?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help