Hans Fugal wrote:
> ARGC = ARGV.length
> if (ARGC == 0) or ((ARGC == 1) and not exists?(ARGV[0]))
> treeish = ARGV[0] || 'master'
I might rewrite that as
first = ARGV[0]
if first.nil? or not File.exist?(first)
treeish = first || 'master'
And add a comment - figuring out the intent of the if statement sprained
something.
files = `git diff --name-only '#{treeish}'`.split('\n')
Pardon, that needs to be "\n".
--
Hans Fugal ; http://hans.fugal.net
There's nothing remarkable about it. All one has to do is hit the
right keys at the right time and the instrument plays itself.
-- Johann Sebastian Bach
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/