author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 22 Aug 2007 01:50:12 +0000 (21:50 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 22 Aug 2007 22:18:13 +0000 (15:18 -0700) | ||
commit | e301bfeea19e284344868840793c58d2e7529c74 | |
tree | c872b36d5882a16e9a736439b1c940b7837b5a46 | tree | snapshot |
parent | a475e8095aeb898c1ca60673b82df97d2300cc95 | commit | diff |
Fix new-workdir (again) to work on bare repositories
My day-job workflow involves using multiple workdirs attached to a
bunch of bare repositories. Such repositories are stored inside of
a directory called "foo.git", which means `git rev-parse --git-dir`
will return "." and not ".git". Under such conditions new-workdir
was getting confused about where the Git repository it was supplied
is actually located.
If we get "." for the result of --git-dir query it means we should
use the user supplied path as-is, and not attempt to perform any
magic on it, as the path is directly to the repository.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
My day-job workflow involves using multiple workdirs attached to a
bunch of bare repositories. Such repositories are stored inside of
a directory called "foo.git", which means `git rev-parse --git-dir`
will return "." and not ".git". Under such conditions new-workdir
was getting confused about where the Git repository it was supplied
is actually located.
If we get "." for the result of --git-dir query it means we should
use the user supplied path as-is, and not attempt to perform any
magic on it, as the path is directly to the repository.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/workdir/git-new-workdir | diff | blob | history |