[PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}
David Bremner
david at tethera.net
Sat Mar 8 04:43:26 PST 2014
"W. Trevor King" <wking at tremily.us> writes:
> +sub do_clone {
> + my $repository = shift;
> + system ('git', 'clone', '--bare', $repository, $NMBGIT) == 0
> + or die "'git clone' exited with nonzero value\n";
> + my $branch = git ('symbolic-ref', 'HEAD');
> + $branch =~ s|^refs/heads/||;
> + git ('config', 'remote.origin.fetch', '+refs/heads/*:refs/remotes/origin/*');
> + git ('config', "branch.$branch.remote", 'origin');
> + git ('config', "branch.$branch.merge", 'refs/heads/$branch');
> + do_fetch();
> +}
I think doing a fetch immediately after a clone deserves a comment.
>
> @@ -473,7 +487,7 @@ sub diff_index {
> sub diff_refs {
> my $filter = shift;
> my $ref1 = shift || 'HEAD';
> - my $ref2 = shift || 'FETCH_HEAD';
> + my $ref2 = shift || '@{upstream}';
I wonder about hard-coding '@{upstream}' in several places. What do you
think about a global "constant"? OF course it was hard-coded FETCH_HEAD
before, but I think not in quite as many places.
More information about the notmuch
mailing list