File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -123,14 +123,13 @@ static char *expand_namespace(const char *raw_namespace)
123
123
124
124
static void setup_git_env (void )
125
125
{
126
+ const char * gitfile ;
127
+
126
128
git_dir = getenv (GIT_DIR_ENVIRONMENT );
127
- git_dir = git_dir ? xstrdup (git_dir ) : NULL ;
128
- if (!git_dir ) {
129
- git_dir = read_gitfile (DEFAULT_GIT_DIR_ENVIRONMENT );
130
- git_dir = git_dir ? xstrdup (git_dir ) : NULL ;
131
- }
132
129
if (!git_dir )
133
130
git_dir = DEFAULT_GIT_DIR_ENVIRONMENT ;
131
+ gitfile = read_gitfile (git_dir );
132
+ git_dir = xstrdup (gitfile ? gitfile : git_dir );
134
133
git_object_dir = getenv (DB_ENVIRONMENT );
135
134
if (!git_object_dir ) {
136
135
git_object_dir = xmalloc (strlen (git_dir ) + 9 );
Original file line number Diff line number Diff line change @@ -379,6 +379,10 @@ test_expect_success 'init with separate gitdir' '
379
379
test -d realgitdir/refs
380
380
'
381
381
382
+ test_expect_success ' re-init on .git file' '
383
+ ( cd newdir && git init )
384
+ '
385
+
382
386
test_expect_success ' re-init to update git link' '
383
387
(
384
388
cd newdir &&
You can’t perform that action at this time.
0 commit comments