use filename for getting commit, not the blob of the file
This commit is contained in:
parent
123291a2c2
commit
0fbea3a260
@ -24,12 +24,9 @@ get_blob () { # get the blob of the file(name) passed as $1
|
|||||||
|
|
||||||
get_commit_for_blob () {
|
get_commit_for_blob () {
|
||||||
# search for the blob in all commits for the file(name) $1
|
# search for the blob in all commits for the file(name) $1
|
||||||
echo $1 >> /tmp/blob
|
echo $(git log --all --pretty=format:%H -- $2 |
|
||||||
echo $(git log --all --pretty=format:%H -- $2) >> /tmp/blob
|
xargs -I{} bash -c "git ls-tree {} -- $2 |
|
||||||
echo $(git log --all --pretty=format:%H -- $2 | xargs -I{}) >> /tmp/blob
|
grep -q $1 && echo -n {} && head -n 1")
|
||||||
echo $(git log --all --pretty=format:%H -- $2 | xargs -I{} bash -c "git ls-tree {} -- $2") >> /tmp/blob
|
|
||||||
|
|
||||||
echo $(git log --all --pretty=format:%H -- $2 | xargs -I{} bash -c "git ls-tree {} -- $2 | grep -q $1 && echo {}")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do
|
for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do
|
||||||
@ -41,7 +38,7 @@ for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do
|
|||||||
blob=$(get_blob "$fn")
|
blob=$(get_blob "$fn")
|
||||||
commit=$(get_commit_for_blob $blob "$fn")
|
commit=$(get_commit_for_blob $blob "$fn")
|
||||||
fsize=$(ls -l "$fn" | awk '{ print $5 }')
|
fsize=$(ls -l "$fn" | awk '{ print $5 }')
|
||||||
echo "$fn $fsize b=$blob c=$commit" >> $GIT_PULL_TMP
|
echo "$fn $fsize $blob $commit" >> $GIT_PULL_TMP
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if grep -E -q ".*opkg_commands" <<< $fn; then
|
if grep -E -q ".*opkg_commands" <<< $fn; then
|
||||||
|
Loading…
Reference in New Issue
Block a user