Skip to content

Commit 0048e22

Browse files
committed
git-sizer: don't accept a repository path on the command line
Always use the current directory (or GIT_DIR, if it is set).
1 parent b949b5b commit 0048e22

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ Is your Git repository bursting at the seams?
8080

8181
* On other platforms: TBD
8282

83-
3. Run:
83+
3. Change to the directory containing the Git repository, then run
8484

85-
git sizer [<opt>...] [<path-to-git-repository>]
85+
git sizer [<opt>...]
8686

8787
To get a summary of the current repository, all you need is
8888

git-sizer.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,13 @@ func mainImplementation() error {
107107

108108
args := flag.Args()
109109

110-
var path string
111-
switch len(args) {
112-
case 0:
113-
path = "."
114-
case 1:
115-
path = args[0]
116-
default:
110+
if len(args) != 0 {
117111
return errors.New("excess arguments")
118112
}
119113

120-
repo, err := sizes.NewRepository(path)
114+
repo, err := sizes.NewRepository(".")
121115
if err != nil {
122-
return fmt.Errorf("couldn't open %v: %s", path, err)
116+
return fmt.Errorf("couldn't open Git repository: %s", err)
123117
}
124118
defer repo.Close()
125119

0 commit comments

Comments
 (0)