Repository: clayrisser/dotstow (language: python)

Issue:
Does not work with repos which do not have `master` as default branch
If we use a repo with default branch as `main` it fails with the following error,

> no reference found for shorthand 'master'

The `dotstow pull` command defaults to `master` branch.

Though, 
https://github.com/codejamninja/dotstow/blob/9fa430b47c02c6962cec22be3ead6aa4fdffc63a/src/services/git.ts#L34 allows us to pass in a different **branch**,

the command `pull`,
https://github.com/codejamninja/dotstow/blob/9fa430b47c02c6962cec22be3ead6aa4fdffc63a/src/commands/pull.ts#L14-L19 does not accept any flags other than `debug`


Can you please update `pull` command to accept `branch` as a parameter?


Discussion / hints:
Ok thanks @livingston. Could you send a PR?

Fix patch:
diff --git a/package.json b/package.json
index d3ac22e..33d8e49 100644
--- a/package.json
+++ b/package.json
@@ -87,6 +87,7 @@
     "lib"
   ],
   "jest": {
+    "testEnvironment": "node",
     "testRegex": "tests(/|/.*/)[^_/]*[jt]sx?$",
     "verbose": true
   },
diff --git a/src/commands/pull.ts b/src/commands/pull.ts
index 35d51ce..4434494 100644
--- a/src/commands/pull.ts
+++ b/src/commands/pull.ts
@@ -8,14 +8,18 @@ export default class Pull extends Command {
   static examples = ['$ dotstow pull'];
 
   static flags = {
+    branch: flags.string({ char: 'b', required: false }),
     debug: flags.boolean({ char: 'd', required: false })
   };
 
   async run() {
     const { flags } = this.parse(Pull);
+
     const options: Options = {
-      debug: !!flags.debug
+      debug: !!flags.debug,
+      branch: flags.branch
     };
+
     return pull(options);
   }
 }


Test patch:
diff --git a/tests/commands/pull.ts b/tests/commands/pull.ts
new file mode 100644
index 0000000..573e578
--- /dev/null
+++ b/tests/commands/pull.ts
@@ -0,0 +1,26 @@
+import Pull from '../../src/commands/pull';
+import pull from '../../src/actions/pull';
+
+jest.mock('../../src/actions/pull', () => jest.fn(() => 'PULL_RESPONSE'));
+
+describe('pull command', () => {
+  it('should call `pull` with default options', async () => {
+    const result = await Pull.run([]);
+
+    expect(pull).toHaveBeenCalledWith({ debug: false, branch: undefined });
+
+    expect(result).toBe('PULL_RESPONSE');
+  });
+
+  it('should call `pull` with debug enabled', async () => {
+    await Pull.run(['--debug']);
+
+    expect(pull).toHaveBeenCalledWith({ debug: true, branch: undefined });
+  });
+
+  it('should call `pull` with passed branch', async () => {
+    await Pull.run(['--branch=main']);
+
+    expect(pull).toHaveBeenCalledWith({ debug: false, branch: 'main' });
+  });
+});