-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Returning more information in FetchResult #823
Labels
Comments
steveukx
changed the title
Returning more information in ResultResult
Returning more information in FetchResult
Jul 12, 2022
Hi, as the changes are additive this would be welcomed as a PR. To help you create the PR - this is a stub of an integration for you that sets up a remote repo with local clone, modifies the remote then fetches those changes in the local. // ./simple-git/test/integration/fetch.spec.ts
import { createTestContext, newSimpleGit, setUpInit, SimpleGitTestContext } from '../__fixtures__';
describe('fetch', () => {
let context: SimpleGitTestContext;
let upstream: string;
let local: string;
beforeEach(async () => context = await createTestContext());
beforeEach(async () => {
upstream = await context.dir('upstream');
local = context.path('local');
await context.file(['upstream', 'file']);
await givenRemote(upstream);
await givenLocal(upstream, local);
});
it('fetches updates', async () => {
await givenRemoteChanges(upstream);
const result = await newSimpleGit(local).fetch();
expect(result).toEqual( ... );
})
/**
* Sets up the repo to be used as a local - by cloning the remote
*/
async function givenLocal(upstream: string, local: string) {
await newSimpleGit(context.root).clone(upstream, local);
await setUpInit({git: newSimpleGit(local)});
}
/**
* Sets up the repo to be used as a remote
*/
async function givenRemote(upstream: string) {
const git = newSimpleGit(upstream);
await setUpInit({git});
await git.add('.');
await git.commit('first');
}
/**
* Configure the remote with changes to be retrieved when using fetch on the local
*/
async function givenRemoteChanges(upstream: string) {
const git = newSimpleGit(upstream);
await git.raw('tag', 'alpha');
await git.raw('checkout', '-b', 'bravo');
await context.file(['upstream', 'another-file']);
await git.add('.');
await git.commit('second');
}
}) |
steveukx
added
enhancement
more-info-needed
More information is required in order to investigate
labels
Jul 13, 2022
Thanks! The skeleton integration test was extremely helpful. I like the fixtures you've got set up. PR: #827 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
What are your thoughts on adding more information to
FetchResult
?I'd like to know the updated branches and especially deleted branches.
Currently I can get this via
outputHandler()
, but it's messy since I can't return a result through.Are you open to a PR that adds these fields? Are they deliberately elided (or non-standard between servers)?
Possible format for
FetchResult
LineParsers
The text was updated successfully, but these errors were encountered: