Skip to content

Commit bf0813e

Browse files
committed
Stop submodule '.git' directories from triggering working copy updates
Seems to be an effective workaround for brotherbard#1
1 parent 587cb0b commit bf0813e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

PBGitRepositoryWatcher.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ - (void) _handleEventCallback:(NSArray *)eventPaths {
142142

143143
// subdirs of working dir
144144
else {
145-
event |= PBGitRepositoryWatcherEventTypeWorkingDirectory;
146-
[paths addObject:eventPath.path];
145+
// Try to get the git status of the changed path using libgit2
146+
if (![eventPath.path hasSuffix:@"/.git/"])
147+
{
148+
event |= PBGitRepositoryWatcherEventTypeWorkingDirectory;
149+
[paths addObject:eventPath.path];
150+
}
147151
}
148152
}
149153

0 commit comments

Comments
 (0)