Skip to content

Commit

Permalink
Ignore :ignored files when considering modified? status.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Apr 23, 2023
1 parent 77e613a commit a78ec60
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/teapot/command/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,15 @@ def credentials(url, username, types)
# We should prompt for username/password if required...
return Rugged::Credentials::SshKeyFromAgent.new(username: username)
end


def modified?(repository)
repository.status.each do |path, status|
return true if status != [:ignored]
end

return false
end

def clone_or_pull_package(context, configuration, package, package_lock, logger)
logger.info "Processing #{package}..." #.color(:cyan)

Expand Down Expand Up @@ -150,7 +158,7 @@ def clone_or_pull_package(context, configuration, package, package_lock, logger)
repository = Rugged::Repository.new(destination_path.to_s)

# Are there uncommitted changes in the work tree?
if repository.to_enum(:status).any?
if modified?(repository)
raise FetchError.new(package, "Uncommited local modifications")
end

Expand Down

0 comments on commit a78ec60

Please sign in to comment.