Skip to content

Commit ecb5cd8

Browse files
authored
Merge pull request #398 from gradle/cobexer/directory-specific-git-commit
2 parents c175403 + 1b60340 commit ecb5cd8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

generate-stackbrew-library.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def sort_key(d):
7474
return dirs
7575

7676
def get_directory_commit(branch_commit, dir_path):
77-
"""Get the last merge commit on the first-parent history that changed the given directory."""
78-
output = run_command(["git", "log", "-1", "--first-parent", "--merges", "--format=%H", branch_commit, "--", f"{dir_path}/"])
77+
"""Get the latest commit on the first-parent history that changed the given directory."""
78+
output = run_command(["git", "log", "-1", "--first-parent", "--format=%H", branch_commit, "--", f"{dir_path}/"])
7979
return output.strip()
8080

8181
def get_arches(image, cache):
@@ -150,7 +150,7 @@ def main():
150150

151151
first_version = None
152152
for dir_path in directories:
153-
dir_commit = get_directory_commit(commit, dir_path)
153+
dir_commit = get_directory_commit(commit, dir_path) if int(major) >= 8 else commit
154154
dockerfile = run_command(["git", "show", f"{dir_commit}:{dir_path}/Dockerfile"])
155155

156156
# Extract FROM

0 commit comments

Comments
 (0)