diff options
-rwxr-xr-x | bin/locmaint | 4 | ||||
-rw-r--r-- | perl5/Local/Homedir.pm | 7 | ||||
-rw-r--r-- | perl5/Local/MrRepo/Repo/Git.pm | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/bin/locmaint b/bin/locmaint index 4a2a91f4..9366f6a3 100755 --- a/bin/locmaint +++ b/bin/locmaint @@ -693,8 +693,8 @@ sub loose_src_files { && /([^_]+)_([^_]+)\.orig(?:\.gbp)?\.tar/ && exists $Local::Homedir::debian_source_repos{$1}) }, preprocess => sub { - # don't look inside any repos - return grep { not Local::Homedir::is_repo($_) } @_ + # don't look inside any repos or git worktrees + return grep !Local::Homedir::is_repo($_, 1), @_ }}, "$ENV{HOME}/src"); if (@loose_src_files == 0) { return 0; diff --git a/perl5/Local/Homedir.pm b/perl5/Local/Homedir.pm index 8d4be685..3030f4b0 100644 --- a/perl5/Local/Homedir.pm +++ b/perl5/Local/Homedir.pm @@ -209,10 +209,9 @@ sub say_block (*$$) { } sub is_repo { - my $repo = shift; - # usefully excludes git worktrees - # e.g. s.t. src_register_all ignores ~/src/emacs-snapshot - return -d "$repo/.git" || -d "$repo/.hg"; + my ($repo, $include_worktrees) = @_; + return -d "$repo/.git" || -d "$repo/.hg" + || $include_worktrees && -f "$repo/.git"; } 1; diff --git a/perl5/Local/MrRepo/Repo/Git.pm b/perl5/Local/MrRepo/Repo/Git.pm index 5c9737bc..c0890203 100644 --- a/perl5/Local/MrRepo/Repo/Git.pm +++ b/perl5/Local/MrRepo/Repo/Git.pm @@ -54,6 +54,10 @@ sub review { my $issues = 0; + # TODO Checks (1) and (2) should be done for each worktree. + # + # TODO Similarly, mr's git_status action might look at each worktree? + # 1. Check for a detached HEAD which is not contained in any local # or remote ref, and might therefore contain useful work try { |