Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-24 10:46:13 +0300
committerJunio C Hamano <junkio@cox.net>2005-11-26 00:49:17 +0300
commite8cc80d03934cc607e3a4d89a05350c238dbf9c5 (patch)
tree2b276b1200a1c6f3e6d50ec435530eea9308a2df /git-parse-remote.sh
parentf678dd180a037283decb76201b537dca24de848f (diff)
parse-remote and ls-remote clean-up.
There is no reason to use git-sh-setup from git-ls-remote. git-parse-remote can help the caller to use .git/remotes shortcut if it is run inside a git repository, but can still be useful outside a git repositoryas long as the caller does not use any shortcut. Use "git-rev-parse --git-dir" to figure out where the GIT_DIR is, instead of using git-sh-setup. This also makes "git-ls-remote origin" to work from inside a subdirectory of a git managed repository as a side effect. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-parse-remote.sh')
-rwxr-xr-xgit-parse-remote.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index aea7b0e549..5f158c613f 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -1,6 +1,8 @@
#!/bin/sh
-. git-sh-setup
+# git-ls-remote could be called from outside a git managed repository;
+# this would fail in that case and would issue an error message.
+GIT_DIR=$(git-rev-parse --git-dir 2>/dev/null) || :;
get_data_source () {
case "$1" in