fix setting remote HEAD
[git-remote-gpg.git] / git-remote-gpg
index 6d385d3ac981fad1732271aa75ef62362f3006a1..220924907df034ff0f4312994cb9bf59906ff1c1 100755 (executable)
@@ -79,7 +79,7 @@ our $VERSION = '2014.01.28';
        sub rm (@) {
                foreach my $file (@_) {
                        debug(sub{"file=$file\n"});
-                       if (not -e $file) {
+                       if (-e $file) {
                                unlink($file)
                                        or error("rm $file");
                         }
@@ -173,8 +173,6 @@ our $VERSION = '2014.01.28';
         }
        sub grg_decrypt_symmetric ($$$;$) {
                my ($ctx, $key, $run) = @_;
-               debug(sub{'ctx='}, $ctx);
-               debug(sub{'key='}, $key);
                $run = sub {return @_} unless defined $run;
                IPC::Run::run($run->([@{$ctx->{config}->{gpg}}
                 , '--batch', '--no-default-keyring', '--keyring', '/dev/null', '--secret-keyring', '/dev/null'
@@ -767,8 +765,7 @@ our $VERSION = '2014.01.28';
                 }
                $manifest_refs->{HEAD}
                 = $push_refs->[-1]->{src_obj}
-                       unless exists $manifest_refs->{HEAD}
-                       or @$push_refs == 0;
+                       unless @$push_refs == 0;
                grg_manifest_push($ctx);
                grg_disconnect($ctx);
         }