File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
kaybee/internal/tasks/data Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,15 @@ export:
133133 [ -d $vulnerability_id/$commit_id/before/$(dirname $F) ] || mkdir -p $vulnerability_id/$commit_id/before/$(dirname $F)
134134 [ -d $vulnerability_id/$commit_id/after/$(dirname $F) ] || mkdir -p $vulnerability_id/$commit_id/after/$(dirname $F)
135135
136- git -C $repo_dir show $commit_id~1:$F > $vulnerability_id/$commit_id/before/$F
137- git -C $repo_dir show $commit_id:$F > $vulnerability_id/$commit_id/after/$F
136+ if ( git -C $repo_dir cat-file -e $commit_id~1:$F &> /dev/null )
137+ then
138+ git -C $repo_dir show $commit_id~1:$F > $vulnerability_id/$commit_id/before/$F
139+ fi
140+
141+ if ( git -C $repo_dir cat-file -e $commit_id:$F &> /dev/null )
142+ then
143+ git -C $repo_dir show $commit_id:$F > $vulnerability_id/$commit_id/after/$F
144+ fi
138145 done
139146 }
140147
You can’t perform that action at this time.
0 commit comments