gitgo icon indicating copy to clipboard operation
gitgo copied to clipboard

Switch baseDir to http.FileSystem

Open cryptix opened this issue 10 years ago • 3 comments

Hi!

http.FileSystem would allow to operate in remotes, too.

For locals you would just throw in 'http.Dir(baseDir)'.

cryptix avatar Aug 09 '15 10:08 cryptix

FWIW, I think this is a fantastic idea. :+1:

dmitshur avatar Jan 20 '16 08:01 dmitshur

@shurcooL Thanks for the feedback! This looks feasible, and #5 was the first step towards this.

The challenge is that some of the original functions were written with the assumption that the file would be available locally. Any calls to os.Open (or even os.Stat) will need to be replaced.

I also need to think of how we would test for this given our current testing setup. As I understand it, we can't just test that the current tests work with the new logic. Since our test environment does provide access to the local filesystem, even if we pass in the base directory with http.Dir(baseDir) it will still allow hidden calls to functions that won't work with a remote repository (like os.Open called with a relative path). So we can't use the current tests to be sure that we have eliminated these.

There's probably a way around this; I'll need to think what it would be.

ChimeraCoder avatar Jan 21 '16 05:01 ChimeraCoder

any more thoughts/plans on this one?

imranansari avatar Nov 22 '16 21:11 imranansari