Skip to content

Commit

Permalink
fix: (export to steady) do not create empty files when checking out c…
Browse files Browse the repository at this point in the history
…hanges
  • Loading branch information
sumeetpatil committed Oct 14, 2020
1 parent 94cd21c commit d6a5912
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions kaybee/internal/tasks/data/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,15 @@ export:
[ -d $vulnerability_id/$commit_id/before/$(dirname $F) ] || mkdir -p $vulnerability_id/$commit_id/before/$(dirname $F)
[ -d $vulnerability_id/$commit_id/after/$(dirname $F) ] || mkdir -p $vulnerability_id/$commit_id/after/$(dirname $F)
git -C $repo_dir show $commit_id~1:$F > $vulnerability_id/$commit_id/before/$F
git -C $repo_dir show $commit_id:$F > $vulnerability_id/$commit_id/after/$F
if ( git -C $repo_dir cat-file -e $commit_id~1:$F &> /dev/null )
then
git -C $repo_dir show $commit_id~1:$F > $vulnerability_id/$commit_id/before/$F
fi
if ( git -C $repo_dir cat-file -e $commit_id:$F &> /dev/null )
then
git -C $repo_dir show $commit_id:$F > $vulnerability_id/$commit_id/after/$F
fi
done
}
Expand Down

0 comments on commit d6a5912

Please sign in to comment.