#482 (new-)sources should fail with git tracked files
Merged by onosek. Opened by onosek.
onosek/rpkg stage_check  into  master

Download 482.patch

Implements additional protection (except .gitignore warning) that
prevents overwrite staged files when x-pkg sources is run. And forbids
uploading staged files that may not belong to lookaside cache.

Fixes: https://pagure.io/fedpkg/issue/241
JIRA: COMPOSE-2689

Signed-off-by: Ondrej Nosek onosek@redhat.com

I am gonna add some test before merge.

Is there some reason to not support files in subdirectories? It's not a big deal, since those should not conflict with anything in lookaside, I'm just curious.

This is a great feature!

Currently it will only catch situation when the file is modified and git add was called on it. I think it should also check if the file is generally known to git.

Thanks @lsedlar, I considered your comments. I will look at all (including subdirectories and external) files whether they are tracked in Git repository or not. The new method should also recognize Git tracked files better.

rebased onto cb7789ae2a9d541b231bec16fea4ca79491a19a1

rebased onto 8216735a0945177e1f4e3bccfb1631a45028da3b

Should this be an exception or at least go to stderr?

Maybe use assertTrue and assertFalse?

How about splitting this into one case per method to make sure all problems are detected? Right now if first check fails, nothing else will be done.

A couple minor comments, but the patch looks good to me. :thumbsup:

rebased onto 8f9dbd86847ee862e11ae32aafe912fc7ddccf71

I modified the code as per your comments.

Pull-Request has been merged by onosek

Metadata