Skip to content

Commit 3370668

Browse files
cjanietzazz
authored andcommitted
fix: handling of submodules and .git path (#90) (#92)
1 parent 6862b20 commit 3370668

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/scms/git.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import findUp from 'find-up';
22
import execa from 'execa';
3-
import { dirname } from 'path';
3+
import { dirname, join } from 'path';
4+
import * as fs from 'fs';
45

56
export const name = 'git';
67

78
export const detect = directory => {
9+
if (fs.existsSync(join(directory, '.git'))) {
10+
return directory;
11+
}
12+
813
const gitDirectory = findUp.sync('.git', {
914
cwd: directory,
1015
type: 'directory',

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
resolved "https://registry.yarnpkg.com/@azz/prettier-config/-/prettier-config-1.0.0.tgz#ecd38a9e4152fbd03043e020ee73cd14c0e3c112"
88
integrity sha512-2R3F5XWq8YoBXEbqjlraRt8c6Z8GnV4X/gOw0kAi9dn5aCCFHqqDuprQD0UBds4heH6tRp6ZGSeXyG6YZJUgAQ==
99

10-
"@babel/cli@^7.6 .4":
10+
"@babel/cli@^7.6.4":
1111
version "7.6.4"
1212
resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.6.4.tgz#9b35a4e15fa7d8f487418aaa8229c8b0bc815f20"
1313
integrity sha512-tqrDyvPryBM6xjIyKKUwr3s8CzmmYidwgdswd7Uc/Cv0ogZcuS1TYQTLx/eWKP3UbJ6JxZAiYlBZabXm/rtRsQ==

0 commit comments

Comments
 (0)