Skip to content

Commit 190787d

Browse files
committed
Allow .git file in multirepo set ups #31
1 parent 0682c96 commit 190787d

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

stackmuncher/src/config.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,9 @@ fn validate_project_dir(project: PathBuf) -> PathBuf {
416416
}
417417

418418
// check if there is .git subfolder in the project dir
419-
let git_path = project.join(".git");
420-
if git_path.is_file() {
421-
// multi-repos place .git file in submodules pointing at the parent module
422-
eprintln!(
423-
"STACKMUNCHER CONFIG ERROR: {} is a sub-module in a multi-repo.",
424-
project.to_string_lossy()
425-
);
426-
eprintln!(" Sorry, multi-repos are not supported yet. Try cloning this sub-module as a standalone repo.");
427-
eprintln!(" See https://github.com/stackmuncher/stm_app/issues/31 for details");
428-
help::emit_usage_msg();
429-
exit(1);
430-
} else if !git_path.is_dir() {
419+
// it can also be `.git` text file that contains a pointer to the parent repo
420+
// in a multi-repo set up
421+
if !project.join(".git").exists() {
431422
// there is no sign of git here
432423
eprintln!("STACKMUNCHER ERROR: No Git repository found in {}", project.to_string_lossy());
433424
eprintln!(" * either run the app from the root of a project with a Git repository");

0 commit comments

Comments
 (0)