diff --git a/script-modules/fetch-rules.sh b/script-modules/fetch-rules.sh index d469ee27..53584a0c 100644 --- a/script-modules/fetch-rules.sh +++ b/script-modules/fetch-rules.sh @@ -36,6 +36,10 @@ fetch_revision_git() { git log -n 1 --pretty=format:%H } +local_files_git() { + git diff-files --quiet --ignore-submodules + return $? +} # fetch_revision: Output SCM-dependent revision string of a module # (currently just calls fetch_revision_git) @@ -44,3 +48,18 @@ fetch_revision_git() { fetch_revision() { fetch_revision_git $1 } + +module_get_revision() { + if [ -d "$WORKDIR/$module_dir" ]; then + cd "$WORKDIR/$module_dir" + case "$module_fetch_rule" in + git) + if [ -n "$1" ]; then + git diff-files --quiet --ignore-submodules || echo -n "changed from " + fi + git log -n 1 --pretty=format:%H + ;; + *) ;; + esac + fi +}